From 0b60343a3bae3ad536ff36493710fdc79640ae84 Mon Sep 17 00:00:00 2001 From: Nathan G Date: Mon, 2 Oct 2023 11:10:31 -0700 Subject: [PATCH] Move setIsLoading below if - Reduce calls --- src/components/search/SearchResults.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/search/SearchResults.tsx b/src/components/search/SearchResults.tsx index ae58bc9465..b934ff4cee 100644 --- a/src/components/search/SearchResults.tsx +++ b/src/components/search/SearchResults.tsx @@ -113,13 +113,14 @@ const SearchResults: FunctionComponent = ({ serverId = windo setBooks([]); setPeople([]); setCollections([]); - setIsLoading(true); if (!query) { setIsLoading(false); return; } + setIsLoading(true); + const apiClient = ServerConnections.getApiClient(serverId); const fetchPromises = [];