Files
healer-man/src/game/companionPartyPreferences.ts
T
2026-09-19 21:01:51 -04:00

21 lines
699 B
TypeScript

import { create } from "zustand";
const STORAGE_KEY = "healer-man.include-beta-companion-specs.v1";
function loadPreference(): boolean {
try { return window.localStorage.getItem(STORAGE_KEY) === "true"; } catch { return false; }
}
interface CompanionPartyPreferencesState {
includeBetaSpecs: boolean;
setIncludeBetaSpecs: (include: boolean) => void;
}
export const useCompanionPartyPreferences = create<CompanionPartyPreferencesState>((set) => ({
includeBetaSpecs: loadPreference(),
setIncludeBetaSpecs: (includeBetaSpecs) => {
try { window.localStorage.setItem(STORAGE_KEY, String(includeBetaSpecs)); } catch { /* optional preference */ }
set({ includeBetaSpecs });
},
}));