Skip to content

Commit

Permalink
Set setIsLoading regardless if some results are already there or not
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Jun 18, 2024
1 parent e8f0f08 commit 38f6b5a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions client/pages/search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 38f6b5a

Please sign in to comment.