prefs.set: deep compare

This commit is contained in:
tophf 2017-04-11 16:12:40 +03:00
parent 8c539dabd6
commit 2086f10af4

View File

@ -84,7 +84,7 @@ var prefs = new function Prefs() {
},
set(key, value, {noBroadcast, noSync} = {}) {
const oldValue = deepCopy(values[key]);
const oldValue = values[key];
switch (typeof defaults[key]) {
case typeof value:
break;
@ -250,7 +250,11 @@ var prefs = new function Prefs() {
return false;
}
for (const k in a) {
if (a[k] !== b[k]) {
if (typeof a[k] == 'object') {
if (!equal(a[k], b[k])) {
return false;
}
} else if (a[k] !== b[k]) {
return false;
}
}