From b7ed6eb2540679921f8863e234a5a5988d88de7a Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 12 Aug 2018 21:29:54 +0900 Subject: [PATCH] Limit bookmark items on completion --- src/background/usecases/completions.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/background/usecases/completions.js b/src/background/usecases/completions.js index af7aaf2..9385760 100644 --- a/src/background/usecases/completions.js +++ b/src/background/usecases/completions.js @@ -183,10 +183,11 @@ export default class CompletionsInteractor { async queryBookmarkItems(name, keywords) { let bookmarks = await this.completionRepository.queryBookmarks(keywords); - return bookmarks.map(page => new CompletionItem({ - caption: page.title, - content: name + ' ' + page.url, - url: page.url - })); + return bookmarks.slice(0, COMPLETION_ITEM_LIMIT) + .map(page => new CompletionItem({ + caption: page.title, + content: name + ' ' + page.url, + url: page.url + })); } }