Skip to content

Commit

Permalink
Make extension more resource efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Oct 12, 2023
1 parent 533e4bb commit fe492c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions batime@martin.zurowietz.de/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ const _powerToggleSyncOverride = function () {
};

export default class Extension extends BaseExtension {
constructor(metadata) {
super(metadata);
this._im = new InjectionManager();
}

enable() {
this._im = new InjectionManager();
this._im.overrideMethod(Indicator.prototype, '_sync', function (_sync) {
return function () {
const {powerToggle} = this._systemItem;
Expand All @@ -59,6 +55,7 @@ export default class Extension extends BaseExtension {

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

Expand Down

0 comments on commit fe492c4

Please sign in to comment.