fix(ui): drop pointless equal checks

This commit is contained in:
Łukasz Mierzwa
2020-05-30 17:16:06 +01:00
committed by Łukasz Mierzwa
parent 6b5b53d51d
commit e4ec699abb
2 changed files with 3 additions and 13 deletions

View File

@@ -21,7 +21,6 @@
"bricks.js": "1.8.0",
"copy-to-clipboard": "3.3.1",
"csshake": "1.5.3",
"fast-deep-equal": "3.1.1",
"favico.js": "0.3.10",
"fontfaceobserver": "2.1.0",
"lodash": "4.17.15",

View File

@@ -2,8 +2,6 @@ import { observable, action, computed, toJS } from "mobx";
import throttle from "lodash.throttle";
import equal from "fast-deep-equal";
import qs from "qs";
import moment from "moment";
@@ -403,7 +401,6 @@ class AlertStore {
}
let updates = {};
// update data dicts if they changed
for (const key of [
"colors",
"counters",
@@ -412,13 +409,9 @@ class AlertStore {
"upstreams",
"receivers",
]) {
if (!equal(this.data[key], result[key])) {
updates[key] = result[key];
}
}
if (Object.keys(updates).length > 0) {
this.data = Object.assign(this.data, updates);
updates[key] = result[key];
}
this.data = Object.assign(this.data, updates);
// before storing new version check if we need to reload
if (
@@ -435,9 +428,7 @@ class AlertStore {
}
// settings exported via API
if (!equal(this.settings.values, result.settings)) {
this.settings.values = result.settings;
}
this.settings.values = result.settings;
this.status.setIdle();
});