mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
e50b23d081
* chore(js): be stricter about dead code warnings * chore(js): remove dead code and unused exports * rebase * chore: remove unused files * chore(deps): remove unused prop-types dep * chore(js): remove unused function * chore(deps): remove + check unused deps * chore(js): remove unused exports. Closes #3036
28 lines
584 B
TypeScript
28 lines
584 B
TypeScript
export const LOCAL_STORAGE_KEYS = {
|
|
username: 'username',
|
|
hasDisplayedNotificationModal: 'HAS_DISPLAYED_NOTIFICATION_MODAL',
|
|
userVisitCount: 'USER_VISIT_COUNT',
|
|
};
|
|
|
|
export function getLocalStorage(key) {
|
|
try {
|
|
return localStorage.getItem(key);
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
export function setLocalStorage(key, value) {
|
|
try {
|
|
if (value !== '' && value !== null) {
|
|
localStorage.setItem(key, value);
|
|
} else {
|
|
localStorage.removeItem(key);
|
|
}
|
|
return true;
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
return false;
|
|
}
|