From feac34ba83028b59798d69f55f4cd03b7fc13d16 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 18 May 2023 22:28:53 +0200 Subject: [PATCH] Trigger global search request (#305) Issue introduced with a457d80c446960df5644513fdf4d3a11974243c7. "FetchedSources" was changed to represent the loading state of the request, but it was forgotten to update its usage --- src/screens/SearchAll.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screens/SearchAll.tsx b/src/screens/SearchAll.tsx index 54a1c074..6ef9f88a 100644 --- a/src/screens/SearchAll.tsx +++ b/src/screens/SearchAll.tsx @@ -46,7 +46,7 @@ const SearchAll: React.FC = () => { const [shownLangs, setShownLangs] = useLocalStorage('shownSourceLangs', sourceDefualtLangs()); const [showNsfw] = useLocalStorage('showNsfw', true); - const { data: unsortedSources = [], isLoading: FetchedSources } = requestManager.useGetSourceList(); + const { data: unsortedSources = [], isLoading: isLoadingSources } = requestManager.useGetSourceList(); const sources = useMemo( () => unsortedSources.sort((a: { displayName: string }, b: { displayName: string }) => { @@ -116,7 +116,7 @@ const SearchAll: React.FC = () => { }, [ResetUI]); useEffect(() => { - if (query && FetchedSources) { + if (query && !isLoadingSources) { const delayDebounceFn = setTimeout(() => { setTriggerUpdate(0); }, 1000);