Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 40c1593

Browse files
authored
fix: query stale state (#63)
1 parent fab091f commit 40c1593

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export function ReactQueryDevtools({
196196
}
197197

198198
const getStatusRank = q =>
199-
q.state.isFetching ? 0 : !q.observers.length ? 3 : q.state.isStale ? 2 : 1
199+
q.state.isFetching ? 0 : !q.observers.length ? 3 : q.isStale() ? 2 : 1
200200

201201
const sortFns = {
202202
'Status > Last Updated': (a, b) =>

src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const isServer = typeof window === 'undefined'
88
export function getQueryStatusColor(query, theme) {
99
return query.state.isFetching
1010
? theme.active
11-
: query.state.isStale
11+
: query.isStale()
1212
? theme.warning
1313
: theme.success
1414
}
@@ -22,7 +22,7 @@ export function getQueryStatusLabel(query) {
2222
? 'fetching'
2323
: !query.observers.length
2424
? 'inactive'
25-
: query.state.isStale
25+
: query.isStale()
2626
? 'stale'
2727
: 'fresh'
2828
}

0 commit comments

Comments
 (0)