summaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-14 20:59:42 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-14 20:59:42 +0300
commitb6f7f8c02637cef9cadd4ab2b9f253c42903aee6 (patch)
treee04eeaf732e6c97fc278552e6253675f29481e11 /ext/fg
parent950f50ef94931b4dfe19585ba0d7cb80324524ed (diff)
fix _canEnable being used before setting options
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/frontend.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index bf8cb9b4..6d16cdd9 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -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) {
@@ -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;
}