From 38f6b5a2815902cf2426ec97ba6f1d8c3a4ee48f Mon Sep 17 00:00:00 2001 From: Pierre-Henry Soria Date: Tue, 18 Jun 2024 22:07:14 +1000 Subject: [PATCH] Set `setIsLoading` regardless if some results are already there or not --- client/pages/search/SearchPage.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/pages/search/SearchPage.tsx b/client/pages/search/SearchPage.tsx index c453a0a..a36a552 100644 --- a/client/pages/search/SearchPage.tsx +++ b/client/pages/search/SearchPage.tsx @@ -75,10 +75,7 @@ export const SearchPage = () => { const performSearch = useCallback(async () => { if (query.length) { - if (!searchResults.length) { - // if no results yet, activate loading spinner - setIsLoading(true); - } + setIsLoading(true); try { const results = await search(query);