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.
This commit is contained in:
17
lib/storage.ts
Normal file
17
lib/storage.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// 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.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user