aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/completions.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-08-12 21:40:17 +0900
committerGitHub <noreply@github.com>2018-08-12 21:40:17 +0900
commit1b7784638230dc4960c130181a3e008c96ebfebe (patch)
tree03d5fbfbf51ebe9646ecc7853c909ab12b95256f /src/background/usecases/completions.js
parent7f2fab55a50770a423c18bf361725d8d053620b2 (diff)
parentb4588c80b105bbac0cfb02854a9713530c1995ef (diff)
Merge pull request #455 from ueokande/fix-bookmark-limitation
Limit bookmark items on completion
Diffstat (limited to 'src/background/usecases/completions.js')
-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
+ }));
}
}