From 4048214eb4cd480a843a532feb91ca5787c85737 Mon Sep 17 00:00:00 2001 From: CahidArda Date: Tue, 6 May 2025 10:28:05 +0300 Subject: [PATCH] fix: wait for type request to finish before sending scans --- src/components/databrowser/hooks/use-keys.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/databrowser/hooks/use-keys.tsx b/src/components/databrowser/hooks/use-keys.tsx index 63e82a1..f885ce9 100644 --- a/src/components/databrowser/hooks/use-keys.tsx +++ b/src/components/databrowser/hooks/use-keys.tsx @@ -27,7 +27,7 @@ export const KeysProvider = ({ children }: PropsWithChildren) => { const { search } = useDatabrowserStore() const cleanSearchKey = search.key.replace("*", "") - const { data: exactMatchType } = useFetchKeyType(cleanSearchKey) + const { data: exactMatchType, isFetching } = useFetchKeyType(cleanSearchKey) const { fetchKeys, resetCache } = useFetchKeys(search) const pageRef = useRef(0) @@ -47,6 +47,7 @@ export const KeysProvider = ({ children }: PropsWithChildren) => { getNextPageParam: (lastPage, __, lastPageIndex) => { return lastPage.hasNextPage ? lastPageIndex + 1 : undefined }, + enabled: !isFetching, refetchOnMount: false, })