Skip to content

Commit

Permalink
fix for useLocalState (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
edlouth authored Sep 29, 2023
1 parent 0d55a71 commit 2d85a1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grai-frontend/src/helpers/useLocalState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function useLocalState<T = any>(

useEffect(() => {
if (typeof window !== "undefined" && window.localStorage) {
value
value !== undefined && value !== null
? window.localStorage.setItem(key, JSON.stringify(value))
: window.localStorage.removeItem(key)
}
Expand Down

0 comments on commit 2d85a1c

Please sign in to comment.