Skip to content

Commit 45250ef

Browse files
authored
fix: show loading state even when only exactMatch is loading (#14)
1 parent 77b4e09 commit 45250ef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/databrowser/hooks/use-keys.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const KeysProvider = ({ children }: PropsWithChildren) => {
2727
const { search } = useDatabrowserStore()
2828
const cleanSearchKey = search.key.replace("*", "")
2929

30-
const { data: exactMatchType, isFetching } = useFetchKeyType(cleanSearchKey)
30+
const { data: exactMatchType, isFetching, isLoading } = useFetchKeyType(cleanSearchKey)
3131

3232
const { fetchKeys, resetCache } = useFetchKeys(search)
3333
const pageRef = useRef(0)
@@ -85,7 +85,12 @@ export const KeysProvider = ({ children }: PropsWithChildren) => {
8585
<KeysContext.Provider
8686
value={{
8787
keys,
88-
query,
88+
// @ts-expect-error Ignore the error with spread syntax
89+
query: {
90+
...query,
91+
isLoading: isLoading || query.isLoading,
92+
isFetching: isFetching || query.isFetching,
93+
},
8994
refetch,
9095
}}
9196
>

0 commit comments

Comments
 (0)