From e556871713891849a04240103baeef2a8d5a1e7e Mon Sep 17 00:00:00 2001 From: Benjamin Drieu Date: Thu, 25 Nov 2021 14:45:42 +0100 Subject: [PATCH] Remove transient refresh bug --- extension.js | 11 ++++------- servers/icinga.js | 2 +- servers/icinga2.js | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/extension.js b/extension.js index bc840fa..93cb01e 100644 --- a/extension.js +++ b/extension.js @@ -199,12 +199,7 @@ class Indicator extends PanelMenu.Button { updateStatus ( ) { - if ( ! this.serverLogic.refresh ( this ) ) - { - this.warningBoxes[this.server].set_text ( '…' ); - this.criticalBoxes[this.server].set_text ( '…' ); - } - + this.serverLogic.refresh ( this ); this.setupTimeout ( ); } @@ -302,9 +297,11 @@ class Indicator extends PanelMenu.Button { this._box.remove_all_children(); - if ( this.serverLogic.error ) + if ( this.serverLogic.error || ! this.serverLogic.status ) { this._box.add_child ( new St.Label ( { style_class: 'monito-network-error', text: this.serverLogic.error } ) ); + this.warningBoxes[this.server].set_text ( '…' ); + this.criticalBoxes[this.server].set_text ( '…' ); return; } diff --git a/servers/icinga.js b/servers/icinga.js index 14d3c23..ebe361c 100644 --- a/servers/icinga.js +++ b/servers/icinga.js @@ -96,7 +96,7 @@ class Icinga extends GenericServer { this.extension.refreshUI ( this ); - return this.status != { }; + return ! this.error; } catch ( e ) { diff --git a/servers/icinga2.js b/servers/icinga2.js index 8f1df1c..04480b9 100644 --- a/servers/icinga2.js +++ b/servers/icinga2.js @@ -76,7 +76,7 @@ class Icinga2 extends GenericServer { } this.extension.refreshUI ( this ); - return this.status != { }; + return ! this.error; } }