0
0
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:
Trevor Buckner
2025-10-04 21:47:21 -04:00
committed by GitHub

View File

@@ -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);
} }
}); });