Skip to content

Commit

Permalink
Close and open search depending on the location and available query
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda committed Nov 12, 2023
1 parent 0b14f36 commit f9262ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/util/AppbarSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export const AppbarSearch: React.FunctionComponent<IProps> = (props) => {
}, []);

useEffect(() => {
if (query === undefined && searchString !== undefined) {
setSearchString('');
setSearchOpen(false);
return;
}

if (searchString === '' && !!query) {
setSearchString(query);
setSearchOpen(true);
Expand Down

0 comments on commit f9262ac

Please sign in to comment.