Move setIsLoading below if - Reduce calls
This commit is contained in:
@@ -113,13 +113,14 @@ const SearchResults: FunctionComponent<SearchResultsProps> = ({ serverId = windo
|
||||
setBooks([]);
|
||||
setPeople([]);
|
||||
setCollections([]);
|
||||
setIsLoading(true);
|
||||
|
||||
if (!query) {
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
const apiClient = ServerConnections.getApiClient(serverId);
|
||||
const fetchPromises = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user