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:
parent
383895fd92
commit
0f16e20d92
|
@ -132,7 +132,7 @@
|
|||
_this.state.delete(collapsiblePath);
|
||||
_this.collapse($collapsible);
|
||||
} else {
|
||||
_this.state.set(collapsiblePath, 1);
|
||||
_this.state.set(collapsiblePath);
|
||||
_this.expand($collapsible);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue