Files
compor-academy/lib/storage.ts
Cauê Faleiros 21085e887d
All checks were successful
CI / Validate frontend and API (push) Successful in 2m22s
CI / Build and publish Docker images (push) Successful in 1m6s
feat: finalize academy redesign and production readiness
Align admin, community, search, library, learning and course management with the mockup. Add saved courses, download history, public community feed, instructor directory, backend search, course views, admin content tools and community moderation. Harden API and Nginx for production.
2026-11-05 15:06:53 -03:00

18 lines
489 B
TypeScript

// Per-viewer UI preferences (theme, sidebar). Storage can be unavailable in
// private windows, so every access is guarded and falls back to the default.
export const readPreference = (key: string): string | null => {
try {
return window.localStorage.getItem(key);
} catch {
return null;
}
};
export const writePreference = (key: string, value: string) => {
try {
window.localStorage.setItem(key, value);
} catch {
// Preference simply isn't remembered.
}
};