mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 16:12:38 +00:00
small cleanups of localstorage keys code
This commit is contained in:
@@ -26,7 +26,7 @@ const getLocalStorageMap = function(){
|
|||||||
|
|
||||||
if(global?.account?.username){
|
if(global?.account?.username){
|
||||||
const username = global.account.username;
|
const username = global.account.username;
|
||||||
localStorageMap[`HOMEBREWERY-DEFAULT-SAVE-LOCATION-${username}`] = `HB_editor_defaultSave_${username}`;
|
localStorageMap[`HOMEBREWERY-DEFAULT-SAVE-LOCATION-${username}`] = `HB_editor_defaultSave_${username}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return localStorageMap;
|
return localStorageMap;
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ const updateLocalStorage = function(){
|
|||||||
// Return if no window and thus no local storage
|
// Return if no window and thus no local storage
|
||||||
if(typeof window === 'undefined') return;
|
if(typeof window === 'undefined') return;
|
||||||
|
|
||||||
// Return if the local storage key map has no content
|
|
||||||
const localStorageKeyMap = getLocalStorageMap();
|
const localStorageKeyMap = getLocalStorageMap();
|
||||||
if(Object.keys(localStorageKeyMap).length == 0) return;
|
|
||||||
|
|
||||||
const storage = window.localStorage;
|
const storage = window.localStorage;
|
||||||
|
|
||||||
Object.keys(localStorageKeyMap).forEach((key)=>{
|
Object.keys(localStorageKeyMap).forEach((key)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user