Limit bookmark items on completion

jh-changes
Shin'ya Ueoka 6 years ago
parent 7f2fab55a5
commit b7ed6eb254
  1. 11
      src/background/usecases/completions.js

@ -183,10 +183,11 @@ export default class CompletionsInteractor {
async queryBookmarkItems(name, keywords) { async queryBookmarkItems(name, keywords) {
let bookmarks = await this.completionRepository.queryBookmarks(keywords); let bookmarks = await this.completionRepository.queryBookmarks(keywords);
return bookmarks.map(page => new CompletionItem({ return bookmarks.slice(0, COMPLETION_ITEM_LIMIT)
caption: page.title, .map(page => new CompletionItem({
content: name + ' ' + page.url, caption: page.title,
url: page.url content: name + ' ' + page.url,
})); url: page.url
}));
} }
} }