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

Commit

Permalink
fix: do not show undefined queryHash
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jul 1, 2020
1 parent 474a429 commit 194c5e9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
sorted.reverse()
}

return match(sorted, filter, { keys: ['queryHash'] })
return match(sorted, filter, { keys: ['queryHash'] }).filter(
d => d.queryHash
)
}, [sortDesc, sortFn, unsortedQueries, filter])

const [activeQuery, activeQueryJson] = React.useMemo(() => {
Expand Down Expand Up @@ -388,9 +390,9 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
overflow: 'auto',
}}
>
{queries.map(query => (
{queries.map((query, i) => (
<div
key={query.queryHash}
key={query.queryHash || i}
onClick={() =>
setActiveQueryHash(
activeQueryHash === query.queryHash ? '' : query.queryHash
Expand Down Expand Up @@ -434,7 +436,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
padding: '.5rem',
}}
>
{query.queryHash}
{`${query.queryHash}`}
</Code>
</div>
))}
Expand Down

0 comments on commit 194c5e9

Please sign in to comment.