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:
@@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user