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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-07-04 21:59:59 +02:00
parent 1d3d61ead9
commit 76899da698

View File

@ -59,7 +59,14 @@ Ext.define('Proxmox.widget.Info', {
}, },
updateValue: function(text, usage) { 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'); var label = me.getComponent('label');
label.update(Ext.apply(label.data, { title: me.title, usage: text })); label.update(Ext.apply(label.data, { title: me.title, usage: text }));