feat(settings): add sidebar visibility state to settings store

This commit is contained in:
2026-07-31 19:31:08 +02:00
parent 5fe4557d94
commit 3623701548
2 changed files with 6 additions and 4 deletions
+4 -3
View File
@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { sluggy } from '#imports'; import { sluggy, useSettingsStore } from '#imports';
import { useHuntStore } from '~/stores/hunt'; import { useHuntStore } from '~/stores/hunt';
import { useTitleStore } from '~/stores/title'; import { useTitleStore } from '~/stores/title';
@@ -11,7 +11,8 @@ const breakpoints = useBreakpoint();
const titleStore = useTitleStore(); const titleStore = useTitleStore();
const huntStore = useHuntStore(); const huntStore = useHuntStore();
const isSidebarVisible = ref(breakpoints.mdUp); const settingsStore = useSettingsStore();
const { isSidebarVisible } = storeToRefs(settingsStore);
const slugs = computed(() => checkSlug(route.params)); const slugs = computed(() => checkSlug(route.params));
@@ -50,7 +51,7 @@ const isHuntAdmin = computed(
</template> </template>
<template #left> <template #left>
<VaSidebar v-model="isSidebarVisible"> <VaSidebar v-model="isSidebarVisible" :hoverable="breakpoints.mdUp">
<VaSidebarItem <VaSidebarItem
:to="localePath('/')" :to="localePath('/')"
:active="localePath('/') === route.path" :active="localePath('/') === route.path"
+2 -1
View File
@@ -2,8 +2,9 @@ export const useSettingsStore = defineStore(
'picSettings', 'picSettings',
() => { () => {
const hideAnswers = ref(true); const hideAnswers = ref(true);
const isSidebarVisible = ref(false);
return { hideAnswers }; return { hideAnswers, isSidebarVisible };
}, },
{ persist: true } { persist: true }
); );