0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-18 18:42:41 +00:00

Tweak local storage update logic

This commit is contained in:
G.Ambatte
2025-09-11 21:25:13 +12:00
parent a11fa72261
commit 1459f6a320

View File

@@ -11,9 +11,9 @@ const updateLocalStorage = function(){
const storage = window.localStorage; const storage = window.localStorage;
Object.keys(localStorageKeyMap).forEach((key)=>{ Object.keys(localStorageKeyMap).forEach((key)=>{
if(storage[key]){ if(storage[key] && !storage[localStorageKeyMap[key]]){
const data = storage.getItem(key); const data = storage.getItem(key);
if(!storage[localStorageKeyMap[key]]) storage.setItem(localStorageKeyMap[key], data); storage.setItem(localStorageKeyMap[key], data);
// storage.removeItem(key); // storage.removeItem(key);
} }
}); });