mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
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.state.delete(collapsiblePath);
|
||||||
_this.collapse($collapsible);
|
_this.collapse($collapsible);
|
||||||
} else {
|
} else {
|
||||||
_this.state.set(collapsiblePath, 1);
|
_this.state.set(collapsiblePath);
|
||||||
_this.expand($collapsible);
|
_this.expand($collapsible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,11 +312,15 @@
|
|||||||
* Set the value for the key in the map
|
* Set the value for the key in the map
|
||||||
*
|
*
|
||||||
* @param {string} key
|
* @param {string} key
|
||||||
* @param {*} value
|
* @param {*} value Default null
|
||||||
*
|
*
|
||||||
* @returns {this}
|
* @returns {this}
|
||||||
*/
|
*/
|
||||||
set: function(key, value) {
|
set: function(key, value) {
|
||||||
|
if (typeof value === 'undefined') {
|
||||||
|
value = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.data.set(key, {'value': value, 'lastAccess': Date.now()});
|
this.data.set(key, {'value': value, 'lastAccess': Date.now()});
|
||||||
|
|
||||||
this.updateStorage();
|
this.updateStorage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user