From 76899da69807aaac6d3a4d5e22d2e6c2ca443499 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sun, 4 Jul 2021 21:59:59 +0200 Subject: [PATCH] info widget: early return from update if text & value stayed the same No need then and if we'd call into update we'd still generate new elements which is annoying for debugging and extra DOM work we can avoid. Signed-off-by: Thomas Lamprecht --- src/panel/InfoWidget.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panel/InfoWidget.js b/src/panel/InfoWidget.js index 3f4525e..de269f3 100644 --- a/src/panel/InfoWidget.js +++ b/src/panel/InfoWidget.js @@ -59,7 +59,14 @@ Ext.define('Proxmox.widget.Info', { }, updateValue: function(text, usage) { - var me = this; + let me = this; + + if (me.lastText === text && me.lastUsage === usage) { + return; + } + me.lastText = text; + me.lastUsage = usage; + var label = me.getComponent('label'); label.update(Ext.apply(label.data, { title: me.title, usage: text }));