Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
fix _canEnable being used before setting options
Browse files Browse the repository at this point in the history
  • Loading branch information
siikamiika committed Apr 14, 2020
1 parent 950f50e commit b6f7f8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/fg/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class Frontend extends TextScanner {
}

async updateOptions() {
this.setOptions(await apiOptionsGet(this.getOptionsContext()), this._canEnable());
this.options = await apiOptionsGet(this.getOptionsContext());
this.setOptions(this.options, this._canEnable());

const ignoreNodes = ['.scan-disable', '.scan-disable *'];
if (!this.options.scanning.enableOnPopupExpressions) {
Expand Down Expand Up @@ -287,7 +288,6 @@ class Frontend extends TextScanner {
}

_canEnable() {
if (this.options === null) { return true; } // called by updateOptions for the first time
return this.popup.depth <= this.options.scanning.popupNestingMaxDepth && !this._disabledOverride;
}

Expand Down

0 comments on commit b6f7f8c

Please sign in to comment.