"use client"; /** * The Frutiger Aero soundtrack's little store. * * The player itself lives in components/AeroMusic.tsx; this is the one bit of * state that outlives it: whether the listener turned the music off. The flag * clears when Aero is (re)selected in Settings — picking the theme again is * the gesture that says "play it". */ const STORAGE_KEY = "freezmo.aero-music.v1"; let dismissed = false; let loaded = false; function load(): void { if (loaded) return; loaded = true; try { dismissed = window.localStorage.getItem(STORAGE_KEY) === "off"; } catch { /* private mode */ } } /** True while the Aero player may run (Aero on, not turned off). */ export function aeroMusicEnabled(): boolean { load(); return !dismissed; } /** The listener closed the player: stop until the theme is chosen again. */ export function dismissAeroMusic(): void { dismissed = true; loaded = true; try { window.localStorage.setItem(STORAGE_KEY, "off"); } catch { /* private mode */ } } /** Selecting Aero again is fresh consent. */ export function allowAeroMusic(): void { dismissed = false; loaded = true; try { window.localStorage.removeItem(STORAGE_KEY); } catch { /* private mode */ } }