diff --git a/batime@martin.zurowietz.de/extension.js b/batime@martin.zurowietz.de/extension.js index 6f92d8f..65f5b75 100644 --- a/batime@martin.zurowietz.de/extension.js +++ b/batime@martin.zurowietz.de/extension.js @@ -6,13 +6,14 @@ class BaTimeExtension { constructor() { this.aggregateMenu = Panel.statusArea.quickSettings; this.originalIndicator = this.aggregateMenu._system; - this.customIndicator = new BaTime.imports.power.Indicator(); + this.aggregateMenu._system = this.customIndicator = new BaTime.imports.power.Indicator(); this.aggregateMenu._indicators.replace_child( this.originalIndicator, this.customIndicator ); } destroy() { + this.aggregateMenu._system = this.originalIndicator; this.aggregateMenu._indicators.replace_child( this.customIndicator, this.originalIndicator diff --git a/batime@martin.zurowietz.de/power.js b/batime@martin.zurowietz.de/power.js index a544a5f..0e4093a 100644 --- a/batime@martin.zurowietz.de/power.js +++ b/batime@martin.zurowietz.de/power.js @@ -7,7 +7,8 @@ var Indicator = GObject.registerClass( // Adapted from _getStatus of the parent. _getTime() { let seconds = 0; - let state = this._systemItem.powerToggle._proxy.State; + let proxy = this._systemItem.powerToggle._proxy; + let state = proxy.State; if (state === UPower.DeviceState.FULLY_CHARGED) { return '';