diff --git a/client/components/SearchForm.tsx b/client/components/SearchForm.tsx index 002c94e..8872e4f 100644 --- a/client/components/SearchForm.tsx +++ b/client/components/SearchForm.tsx @@ -15,9 +15,6 @@ interface SearchFormProps { export function SearchForm({ query, updateQuery }: SearchFormProps) { const textAreaRef = useRef(null); - const [isFirstClick, setIsFirstClick] = useState( - !sessionStorage.getItem(LocalStorageKeys.FIRST_VISIT) - ); const windowInnerHeight = useWindowInnerHeight(); const [suggestedQuery, setSuggestedQuery] = useState( @@ -57,10 +54,10 @@ export function SearchForm({ query, updateQuery }: SearchFormProps) { }; const handleTextAreaClick = () => { - if (isFirstClick) { + const isFirstVisit = localStorage.getItem(LocalStorageKeys.FIRST_VISIT); + if (!isFirstVisit) { confetti(); - setIsFirstClick(false); - sessionStorage.setItem(LocalStorageKeys.FIRST_VISIT, "true"); + localStorage.setItem(LocalStorageKeys.FIRST_VISIT, "true"); } };