Skip to content

Commit

Permalink
Merge branch 'gnome-45'
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Oct 11, 2023
2 parents 84c41c4 + d77aad1 commit 533e4bb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions batime@martin.zurowietz.de/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Extension extends BaseExtension {
constructor(metadata) {
super(metadata);
this._im = new InjectionManager();
}
}

enable() {
this._im.overrideMethod(Indicator.prototype, '_sync', function (_sync) {
Expand All @@ -52,14 +52,17 @@ export default class Extension extends BaseExtension {
};
});

// This is called if the extension is enabled after startup.
// This is called in case the extension is enabled after startup.
// During startup, the _system indicator is not created at this point, yet.
if (panel.statusArea?.quickSettings?._system?._systemItem?.powerToggle) {
panel.statusArea.quickSettings._system._systemItem.powerToggle._sync();
}
this._syncToggle();
}

disable() {
this._im.clear();
this._syncToggle();
}

_syncToggle() {
if (panel.statusArea?.quickSettings?._system?._systemItem?.powerToggle) {
panel.statusArea.quickSettings._system._systemItem.powerToggle._sync();
}
Expand Down

0 comments on commit 533e4bb

Please sign in to comment.