Skip to content

Commit

Permalink
fix: now history is only shown to search bars that have id to save hi… (
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Dec 19, 2023
1 parent 33f82da commit 42943ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/component/common/Search/Search.tsx
Expand Up @@ -155,6 +155,8 @@ export const Search = ({
setValue(initialValue);
}, [initialValue]);

const historyEnabled = showSuggestions && id;

return (
<StyledContainer
ref={searchContainerRef}
Expand Down Expand Up @@ -223,8 +225,7 @@ export const Search = ({
/>
}
elseShow={
showSuggestions &&
savedQuery && (
historyEnabled && (
<SearchPaper className='dropdown-outline'>
<SearchHistory
onSuggestion={onSearchChange}
Expand Down

0 comments on commit 42943ad

Please sign in to comment.