diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-08-12 21:29:54 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-08-12 21:29:54 +0900 |
commit | b7ed6eb2540679921f8863e234a5a5988d88de7a (patch) | |
tree | 1a5ccfb00564f9ec0df7f1a22af0fafd41555840 /src | |
parent | 7f2fab55a50770a423c18bf361725d8d053620b2 (diff) |
Limit bookmark items on completion
Diffstat (limited to 'src')
-rw-r--r-- | src/background/usecases/completions.js | 11 |
1 files 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 + })); } } |