diff --git a/src/store/modules/settings/helper.ts b/src/store/modules/settings/helper.ts index 98e932b67c..a552f7baee 100644 --- a/src/store/modules/settings/helper.ts +++ b/src/store/modules/settings/helper.ts @@ -21,3 +21,7 @@ export function getLocalState(): SettingsState { export function setLocalState(setting: SettingsState): void { ss.set(LOCAL_NAME, setting) } + +export function removeLocalState() { + ss.remove(LOCAL_NAME) +} diff --git a/src/store/modules/settings/index.ts b/src/store/modules/settings/index.ts index 7f7931b208..0dbb796b46 100644 --- a/src/store/modules/settings/index.ts +++ b/src/store/modules/settings/index.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia' import type { SettingsState } from './helper' -import { defaultSetting, getLocalState, setLocalState } from './helper' +import { defaultSetting, getLocalState, removeLocalState, setLocalState } from './helper' export const useSettingStore = defineStore('setting-store', { state: (): SettingsState => getLocalState(), @@ -12,7 +12,7 @@ export const useSettingStore = defineStore('setting-store', { resetSetting() { this.$state = defaultSetting() - this.recordState() + removeLocalState() }, recordState() {