From 5cceba15e2db85f77dd80b24f1ad25b18775df94 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 9 Dec 2019 21:13:03 -0500 Subject: Move apiKanjiFind implementation into Backend --- ext/bg/js/backend.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ext/bg/js/backend.js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 5753e16e..0cac68f8 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -240,8 +240,11 @@ class Backend { this.onOptionsUpdated(source); } - _onApiKanjiFind({text, optionsContext}) { - return apiKanjiFind(text, optionsContext); + async _onApiKanjiFind({text, optionsContext}) { + const options = await this.getOptions(optionsContext); + const definitions = await this.translator.findKanji(text, options); + definitions.splice(options.general.maxResults); + return definitions; } _onApiTermsFind({text, details, optionsContext}) { -- cgit v1.2.3