From b6f7f8c02637cef9cadd4ab2b9f253c42903aee6 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 14 Apr 2020 20:59:42 +0300 Subject: fix _canEnable being used before setting options --- ext/fg/js/frontend.js | 4 ++-- 1 file 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; } -- cgit v1.2.3