Skip to content

Commit

Permalink
Move setIsLoading before try block
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Jun 5, 2024
1 parent 64bab74 commit a54f511
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/pages/search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export const SearchPage = () => {

const performSearch = useCallback(async () => {
if (query.length) {
try {
if (!searchResults.length) {
// if no results yet, activate loading spinner
setIsLoading(true);
}
if (!searchResults.length) {
// if no results yet, activate loading spinner
setIsLoading(true);
}

try {
const results = await search(query);
setSearchResults(results);

Expand Down

0 comments on commit a54f511

Please sign in to comment.