mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 17:52:47 +00:00
Merge pull request #4455 from G-Ambatte/enableOldKeyDeletion
Permanently enable old local storage key deletion
This commit is contained in:
@@ -10,15 +10,13 @@ const updateLocalStorage = function(){
|
|||||||
|
|
||||||
const storage = window.localStorage;
|
const storage = window.localStorage;
|
||||||
|
|
||||||
const deleteKeys = storage?.getItem('HB_deleteKeys') != null;
|
|
||||||
|
|
||||||
Object.keys(localStorageKeyMap).forEach((key)=>{
|
Object.keys(localStorageKeyMap).forEach((key)=>{
|
||||||
if(storage[key]){
|
if(storage[key]){
|
||||||
if(!storage[localStorageKeyMap[key]]){
|
if(!storage[localStorageKeyMap[key]]){
|
||||||
const data = storage.getItem(key);
|
const data = storage.getItem(key);
|
||||||
storage.setItem(localStorageKeyMap[key], data);
|
storage.setItem(localStorageKeyMap[key], data);
|
||||||
};
|
};
|
||||||
if(deleteKeys) storage.removeItem(key);
|
storage.removeItem(key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user