only store values that differ from defaults
This commit is contained in:
parent
3384a8c1f7
commit
9c2408c560
|
@ -138,7 +138,13 @@
|
|||
(type === "number") ||
|
||||
(type === "object") ||
|
||||
(type === "string")) {
|
||||
localStorage.setItem("trivabble" + key, value);
|
||||
if (Object.prototype.hasOwnProperty.call(Conf, key) && (Conf[key] === value)) {
|
||||
if (Object.prototype.hasOwnProperty.call(localStorage, "trivabble" + key)) {
|
||||
delete localStorage["trivabble" + key];
|
||||
}
|
||||
} else {
|
||||
localStorage.setItem("trivabble" + key, value);
|
||||
}
|
||||
} else {
|
||||
console.error("Unsupported type");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue