1
0
Fork 0
forked from Mirrors/gomuks

web/preferences: fix saving deletions to localstorage

This commit is contained in:
Tulir Asokan 2024-12-06 15:01:24 +02:00
parent 3b05d14fbd
commit a3873643ec

View file

@ -54,6 +54,8 @@ export function getLocalStoragePreferences(localStorageKey: string, onChange: ()
delete target[key]
if (Object.keys(target).length === 0) {
localStorage.removeItem(localStorageKey)
} else {
localStorage.setItem(localStorageKey, JSON.stringify(target))
}
onChange()
return true