| @@ -1,4 +1,5 @@ | ||
| 1 | +import { safeLocalStorage } from '@shared/state/safe-local-storage'; | |
| 1 | 2 | import { create } from 'zustand'; |
| 2 | 3 | import { createJSONStorage, devtools, persist } from 'zustand/middleware'; |
| 3 | 4 | |
| 4 | 5 | const initialState = { |
| @@ -35,7 +36,7 @@ | ||
| 35 | 36 | |
| 36 | 37 | export const useAIChatStore = create( |
| 37 | 38 | persist(devtools(state, { name: 'Extendify Chat History' }), { |
| 38 | 39 | name: `extendify-chat-history-${window.extSharedData.siteId}`, |
| 39 | - storage: createJSONStorage(() => localStorage), | |
| 40 | + storage: createJSONStorage(() => safeLocalStorage), | |
| 40 | 41 | }), |
| 41 | 42 | ); |