collapsed left column - moved from settings to storage

This commit is contained in:
Jan Prochazka
2021-12-30 17:36:46 +01:00
parent 064a5f5564
commit 0b81ea8f4e
7 changed files with 17 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
const cache = {};
export function getLocalStorage(key) {
export function getLocalStorage(key, defaultValue = undefined) {
if (key in cache) return cache[key];
const item = localStorage.getItem(key);
if (item) {
@@ -8,7 +8,7 @@ export function getLocalStorage(key) {
cache[key] = res;
return res;
}
return undefined;
return defaultValue;
}
export function setLocalStorage(key, value) {