export const useSettingsStore = defineStore( 'picSettings', () => { const hideAnswers = ref(true); const isSidebarVisible = ref(false); // Per-hunt, client-only consent for GPS distance tracking. Off by default; // the server cannot prove consent, so this lives only in the client store. const trackConsent = ref>({}); function hasTrackConsent(huntId: number): boolean { return trackConsent.value[huntId] ?? false; } function setTrackConsent(huntId: number, consent: boolean) { trackConsent.value[huntId] = consent; } return { hideAnswers, isSidebarVisible, trackConsent, hasTrackConsent, setTrackConsent }; }, { persist: true } ); if (import.meta.hot) { import.meta.hot.accept(acceptHMRUpdate(useSettingsStore, import.meta.hot)); }