only store values that differ from defaults
This commit is contained in:
parent
3384a8c1f7
commit
9c2408c560
|
@ -138,7 +138,13 @@
|
||||||
(type === "number") ||
|
(type === "number") ||
|
||||||
(type === "object") ||
|
(type === "object") ||
|
||||||
(type === "string")) {
|
(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 {
|
} else {
|
||||||
console.error("Unsupported type");
|
console.error("Unsupported type");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue