summaryrefslogtreecommitdiff
path: root/ext/bg/js/query-parser.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-08 17:53:17 -0500
committerGitHub <noreply@github.com>2021-02-08 17:53:17 -0500
commite386599872ed4549b9279fe8386cd902eb96d5fe (patch)
tree684ebd30a790230283f4d48ccbfd9ff361bbe061 /ext/bg/js/query-parser.js
parent69e8addb4722fa0b35bb7a8bb1d0107038a6d249 (diff)
Fix changing the parser not immediately updating (#1358)
Diffstat (limited to 'ext/bg/js/query-parser.js')
-rw-r--r--ext/bg/js/query-parser.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/bg/js/query-parser.js b/ext/bg/js/query-parser.js
index ea215582..05ebfa27 100644
--- a/ext/bg/js/query-parser.js
+++ b/ext/bg/js/query-parser.js
@@ -53,7 +53,9 @@ class QueryParser extends EventDispatcher {
}
setOptions({selectedParser, termSpacing, scanning}) {
+ let selectedParserChanged = false;
if (selectedParser === null || typeof selectedParser === 'string') {
+ selectedParserChanged = (this._selectedParser !== selectedParser);
this._selectedParser = selectedParser;
}
if (typeof termSpacing === 'boolean') {
@@ -63,6 +65,9 @@ class QueryParser extends EventDispatcher {
this._textScanner.setOptions(scanning);
}
this._textScanner.setEnabled(true);
+ if (selectedParserChanged && this._parseResults.length > 0) {
+ this._renderParseResult();
+ }
}
async setText(text) {