mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-26 03:02:40 +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 deleteKeys = storage?.getItem('HB_deleteKeys') != null;
|
||||
|
||||
Object.keys(localStorageKeyMap).forEach((key)=>{
|
||||
if(storage[key]){
|
||||
if(!storage[localStorageKeyMap[key]]){
|
||||
const data = storage.getItem(key);
|
||||
storage.setItem(localStorageKeyMap[key], data);
|
||||
};
|
||||
if(deleteKeys) storage.removeItem(key);
|
||||
storage.removeItem(key);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user