storage.js: Properly check if we have any keys left before clearing the storage

This commit is contained in:
Johannes Meyer 2019-07-25 10:14:48 +02:00
parent 226b58ac9d
commit 2179518904
1 changed files with 2 additions and 2 deletions

View File

@ -234,9 +234,9 @@
}, this);
}
if (!! items && items.length) {
if (!! items && Object.keys(items).length) {
storage.set(key, items);
} else if(items !== null) {
} else if (items !== null) {
storage.remove(key);
}