aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bg/js/api.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index f379e65a..c50db76f 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -75,16 +75,15 @@ async function apiOptionsSave(source) {
async function apiTermsFind(text, optionsContext) {
const options = await apiOptionsGet(optionsContext);
const [definitions, length] = await utilBackend().translator.findTerms(text, options);
- return {
- length,
- definitions: definitions.slice(0, options.general.maxResults)
- };
+ definitions.splice(options.general.maxResults);
+ return {length, definitions};
}
async function apiKanjiFind(text, optionsContext) {
const options = await apiOptionsGet(optionsContext);
const definitions = await utilBackend().translator.findKanji(text, options);
- return definitions.slice(0, options.general.maxResults);
+ definitions.splice(options.general.maxResults);
+ return definitions;
}
async function apiDefinitionAdd(definition, mode, context, optionsContext) {