Files
rehearshalhub/web/src/stores/bandStore.ts
Mistral Vibe 8ea114755a view v2 update
2026-04-10 00:34:09 +02:00

19 lines
502 B
TypeScript

import { create } from "zustand";
interface BandState {
activeBandId: string | null;
setActiveBandId: (id: string | null) => void;
}
function load(): string | null {
try { return localStorage.getItem("rh_active_band_id"); } catch { return null; }
}
export const useBandStore = create<BandState>()((set) => ({
activeBandId: load(),
setActiveBandId: (id) => {
try { if (id) localStorage.setItem("rh_active_band_id", id); } catch { /* ignore */ }
set({ activeBandId: id });
},
}));