mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 12:32:39 +00:00
Move key deletion out of key update check
This commit is contained in:
@@ -11,12 +11,13 @@ const updateLocalStorage = function(){
|
|||||||
const storage = window.localStorage;
|
const storage = window.localStorage;
|
||||||
|
|
||||||
const deleteKeys = storage?.getItem('HB_deleteKeys') != null;
|
const deleteKeys = storage?.getItem('HB_deleteKeys') != null;
|
||||||
console.log('DELETE KEYS:', deleteKeys);
|
|
||||||
|
|
||||||
Object.keys(localStorageKeyMap).forEach((key)=>{
|
Object.keys(localStorageKeyMap).forEach((key)=>{
|
||||||
if(storage[key] && !storage[localStorageKeyMap[key]]){
|
if(storage[key]){
|
||||||
const data = storage.getItem(key);
|
if(!storage[localStorageKeyMap[key]]){
|
||||||
storage.setItem(localStorageKeyMap[key], data);
|
const data = storage.getItem(key);
|
||||||
|
storage.setItem(localStorageKeyMap[key], data);
|
||||||
|
};
|
||||||
if(deleteKeys) storage.removeItem(key);
|
if(deleteKeys) storage.removeItem(key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user