// App-wide "hints" toggle: when on, Tooltip components reveal short explanatory // captions on hover so the UI is somewhat self-documenting for new users. Experienced // users can turn it off in Settings. Persisted to localStorage (+ server preferences). import { onAccountPinned } from "./activeAccount"; import { createStore } from "./store"; import { getAccountRaw, LS, setAccountRaw } from "./storage"; function load(): boolean { return getAccountRaw(LS.hints) !== "0"; // default ON (also when the account isn't known yet) } const store = createStore(load()); // Read at import — in a new tab, before BootGate pins the account — so read again once it is pinned. onAccountPinned(() => store.set(load())); export const hintsEnabled = store.get; export const subscribeHints = store.subscribe; export function setHintsEnabled(v: boolean): void { store.set(v); setAccountRaw(LS.hints, v ? "1" : "0"); }