feat(hunt): track walking distance via GPS, show live locations on map
Add foreground-only GPS distance tracking for hunts
This commit is contained in:
+18
-1
@@ -3,8 +3,25 @@ export const useSettingsStore = defineStore(
|
||||
() => {
|
||||
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<Record<number, boolean>>({});
|
||||
|
||||
return { hideAnswers, isSidebarVisible };
|
||||
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 }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user