From a38b2fce9d9b61c9724438527b25695ef7736886 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:57:16 +0200 Subject: [PATCH] Simplify "useStorage" hook --- src/modules/core/hooks/useStorage.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/core/hooks/useStorage.tsx b/src/modules/core/hooks/useStorage.tsx index 27790bf7..0a565a59 100644 --- a/src/modules/core/hooks/useStorage.tsx +++ b/src/modules/core/hooks/useStorage.tsx @@ -34,8 +34,7 @@ function useStorage( // Allow value to be a function so we have same API as useState const valueToStore = (() => { if (value instanceof Function) { - const previousValue = - jsonSaveParse(storage.getItem(key) ?? '') ?? storage.getItemParsed(key, initialState); + const previousValue = storage.getItemParsed(key, initialState); return value(previousValue); }