summaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-09 21:13:03 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:11:56 -0500
commit5cceba15e2db85f77dd80b24f1ad25b18775df94 (patch)
treea14a0ae142292f71e19068b734aa163b0e08a6a5 /ext/bg/js/api.js
parent8dff73679e909dab8f325cc9458cf5c40c9be485 (diff)
Move apiKanjiFind implementation into Backend
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 3e821333..474365ae 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -105,11 +105,8 @@ async function apiTextParseMecab(text, optionsContext) {
return results;
}
-async function apiKanjiFind(text, optionsContext) {
- const options = await apiOptionsGet(optionsContext);
- const definitions = await utilBackend().translator.findKanji(text, options);
- definitions.splice(options.general.maxResults);
- return definitions;
+function apiKanjiFind(text, optionsContext) {
+ return utilBackend()._onApiKanjiFind({text, optionsContext});
}
async function apiDefinitionAdd(definition, mode, context, optionsContext) {