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

Commit

Permalink
fix: query stale state (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
boschni authored Sep 6, 2020
1 parent fab091f commit 40c1593
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function ReactQueryDevtools({
}

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

const sortFns = {
'Status > Last Updated': (a, b) =>
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const isServer = typeof window === 'undefined'
export function getQueryStatusColor(query, theme) {
return query.state.isFetching
? theme.active
: query.state.isStale
: query.isStale()
? theme.warning
: theme.success
}
Expand All @@ -22,7 +22,7 @@ export function getQueryStatusLabel(query) {
? 'fetching'
: !query.observers.length
? 'inactive'
: query.state.isStale
: query.isStale()
? 'stale'
: 'fresh'
}
Expand Down

0 comments on commit 40c1593

Please sign in to comment.