From e4ec699abb5695e0a80e77213eb077cdd3315e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 30 May 2020 17:16:06 +0100 Subject: [PATCH] fix(ui): drop pointless equal checks --- ui/package.json | 1 - ui/src/Stores/AlertStore.js | 15 +++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ui/package.json b/ui/package.json index d6715d304..c585adbce 100644 --- a/ui/package.json +++ b/ui/package.json @@ -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", diff --git a/ui/src/Stores/AlertStore.js b/ui/src/Stores/AlertStore.js index 84a9edcc3..20d4b7944 100644 --- a/ui/src/Stores/AlertStore.js +++ b/ui/src/Stores/AlertStore.js @@ -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(); });