Use vueuse useStorage instead of manually using localStorage
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { useStorage } from "@vueuse/core";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
interface State {
|
||||
ShowMenu?: boolean,
|
||||
ExpandMenu?: boolean,
|
||||
ShowMenu: boolean | null,
|
||||
ExpandMenu: boolean,
|
||||
}
|
||||
|
||||
export const useSettingsStore = defineStore('settings', {
|
||||
state: (): State => ({
|
||||
ShowMenu: undefined,
|
||||
state: () => useStorage<State>('settings', {
|
||||
ShowMenu: null,
|
||||
ExpandMenu: false,
|
||||
}),
|
||||
actions: {
|
||||
|
Reference in New Issue
Block a user