summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bg/js/api.js3
-rw-r--r--ext/bg/js/translator.js6
2 files changed, 4 insertions, 5 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 9839aef5..b56b3449 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -38,7 +38,8 @@ async function apiTermsFind(text) {
const {definitions, length} = await searcher(
text,
dictEnabledSet(options),
- options.scanning.alphanumeric
+ options.scanning.alphanumeric,
+ options
);
return {
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index c89b43ff..7b952622 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -36,8 +36,7 @@ class Translator {
}
}
- async findTermsGrouped(text, dictionaries, alphanumeric) {
- const options = await apiOptionsGet();
+ async findTermsGrouped(text, dictionaries, alphanumeric, options) {
const titles = Object.keys(dictionaries);
const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
@@ -55,8 +54,7 @@ class Translator {
return {length, definitions: definitionsGrouped};
}
- async findTermsMerged(text, dictionaries, alphanumeric) {
- const options = await apiOptionsGet();
+ async findTermsMerged(text, dictionaries, alphanumeric, options) {
const secondarySearchTitles = Object.keys(options.dictionaries).filter(dict => options.dictionaries[dict].allowSecondarySearches);
const titles = Object.keys(dictionaries);
const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);