aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-08-12 21:29:54 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-08-12 21:29:54 +0900
commitb7ed6eb2540679921f8863e234a5a5988d88de7a (patch)
tree1a5ccfb00564f9ec0df7f1a22af0fafd41555840 /src/background
parent7f2fab55a50770a423c18bf361725d8d053620b2 (diff)
Limit bookmark items on completion
Diffstat (limited to 'src/background')
-rw-r--r--src/background/usecases/completions.js11
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
+ }));
}
}