diff --git a/src/lib/store.ts b/src/lib/store.ts index e5b8efe..267b1ea 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -32,31 +32,11 @@ export const useEditorConfigStore = create((set) => { resetConfig: () => set((state) => { localStorage.removeItem('editorConfig'); return { config: state.defaultConfig }; - }), + }) }; }); -export interface EditorConfigState { +interface EditorConfigState2 { config: any; setConfig: (config: any) => void; } - -export const useEditorConfigStore = create((set) => { - // 从localStorage读取保存的配置 - let savedConfig = null; - if (typeof window !== 'undefined') { - savedConfig = localStorage.getItem('editorConfig'); - } - - const parsedConfig = savedConfig ? JSON.parse(savedConfig) : {}; - - return { - config: parsedConfig, - setConfig: (config) => { - if (typeof window !== 'undefined') { - localStorage.setItem('editorConfig', JSON.stringify(config)); - } - set({ config }); - } - }; -});