storage.js: Write `null` instead of `undefined` to the storage

`undefined` causes the key to be ignored by JSON.stringify
This commit is contained in:
Johannes Meyer 2019-07-10 08:04:10 +02:00
parent 383895fd92
commit 0f16e20d92
2 changed files with 6 additions and 2 deletions

View File

@ -132,7 +132,7 @@
_this.state.delete(collapsiblePath);
_this.collapse($collapsible);
} else {
_this.state.set(collapsiblePath, 1);
_this.state.set(collapsiblePath);
_this.expand($collapsible);
}
}

View File

@ -312,11 +312,15 @@
* Set the value for the key in the map
*
* @param {string} key
* @param {*} value
* @param {*} value Default null
*
* @returns {this}
*/
set: function(key, value) {
if (typeof value === 'undefined') {
value = null;
}
this.data.set(key, {'value': value, 'lastAccess': Date.now()});
this.updateStorage();