feat(settings): render title and menu image in notification

This commit is contained in:
2025-11-25 18:13:52 +01:00
parent 5ca5c5b892
commit e5e08bacbf
8 changed files with 128 additions and 53 deletions

View File

@@ -1,3 +1,23 @@
export const useSettingsStore = defineStore("settings", {
state: () => ({}),
state: () => ({
activeMenu: null as string | null,
}),
getters: {
isMenuOpen: (state) => (menu: string) => {
if (!state.activeMenu) return false;
return new RegExp(`^${menu}[A-Z]`).test(state.activeMenu);
},
isAnyOtherMenuOpen: (state) => (excludeMenu: string) => {
if (!state.activeMenu) return false;
const menus = ["options", "clock", "user", "touchScreen"];
return menus
.filter((m) => m !== excludeMenu)
.some((m) => new RegExp(`^${m}[A-Z]`).test(state.activeMenu!));
},
},
actions: {
setActiveMenu(menu: string | null) {
this.activeMenu = menu;
},
},
});