feat(settings): improve typing

This commit is contained in:
2025-12-30 00:45:13 +01:00
parent 6beba85afa
commit 7ac929cf0d
2 changed files with 21 additions and 6 deletions

View File

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