Files
pihkaal-me/app/stores/settings.ts

26 lines
575 B
TypeScript

type Menu = "options" | "clock" | "user" | "touchScreen";
export const useSettingsStore = defineStore("settings", {
state: () => ({
currentMenu: null as Menu | null,
currentSubMenu: null as string | null,
menuExpanded: false,
}),
actions: {
openMenu(menu: Menu, expanded: boolean = false) {
this.currentMenu = menu;
this.menuExpanded = expanded;
this.currentSubMenu = null;
},
openSubMenu(submenu: string) {
this.currentSubMenu = submenu;
},
closeSubMenu() {
this.currentSubMenu = null;
},
},
});