// localStorage can throw (privacy modes, storage disabled, quota), so every // access is guarded and falls back to "nothing stored". /** The stored value of key, or null if there is none or storage is unavailable. */ export function readStored(key: string): string | null { try { return window.localStorage.getItem(key); } catch { return null; } } /** Stores value under key, if storage is available. */ export function writeStored(key: string, value: string): void { try { window.localStorage.setItem(key, value); } catch { /* preference just won't persist */ } } // index.html reads the theme key too, before the app loads. export const STORAGE_KEYS = { theme: 'job_search.theme', filtersOpen: 'job_search.filtersOpen', } as const;