| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | import { safeParseJson } from '@shared/lib/parsing'; |
| 2 | +import { safeLocalStorage } from '@shared/state/safe-local-storage'; | |
| 2 | 3 | import { create } from 'zustand'; |
| 3 | 4 | import { createJSONStorage, devtools, persist } from 'zustand/middleware'; |
| 4 | 5 | |
| 5 | 6 | const initialState = { |
| @@ -33,9 +34,9 @@ | ||
| 33 | 34 | |
| 34 | 35 | export const usePagesSelectionStore = create( |
| 35 | 36 | persist(devtools(state, { name: 'Extendify Launch Pages Selections' }), { |
| 36 | 37 | name: key, |
| 37 | - storage: createJSONStorage(() => localStorage), | |
| 38 | + storage: createJSONStorage(() => safeLocalStorage), | |
| 38 | 39 | skipHydration: true, |
| 39 | 40 | }), |
| 40 | 41 | state, |
| 41 | 42 | ); |