summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-09 21:15:37 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:11:56 -0500
commit73ce2fe3d3572faa194735052b1448f6a46fa969 (patch)
treeefa5a351207d984ca001156fb3797fb2c4219c51 /ext/bg/js/backend.js
parent5cceba15e2db85f77dd80b24f1ad25b18775df94 (diff)
Move apiTermsFind implementation into Backend
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 0cac68f8..4c3b3dfa 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -247,8 +247,11 @@ class Backend {
return definitions;
}
- _onApiTermsFind({text, details, optionsContext}) {
- return apiTermsFind(text, details, optionsContext);
+ async _onApiTermsFind({text, details, optionsContext}) {
+ const options = await this.getOptions(optionsContext);
+ const [definitions, length] = await this.translator.findTerms(text, details, options);
+ definitions.splice(options.general.maxResults);
+ return {length, definitions};
}
_onApiTextParse({text, optionsContext}) {