Skip to content

Commit

Permalink
Fix bug with useLocalStorage where it always resets the selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendPeter committed Feb 2, 2025
1 parent a9f32d5 commit c2b46d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/hooks/useLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const useLocalStorage = <data>(key: string, defaultValue: data|null, upda
const saved = localStorage.getItem(key);
let initial: data|null;
try {
const initial: data|null = JSON.parse(saved);
initial = JSON.parse(saved);
} catch {}
if (!initial) {
localStorage.setItem(key, JSON.stringify(defaultValue));
Expand Down

0 comments on commit c2b46d6

Please sign in to comment.