aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
authorShin'ya UEOKA <ueokande@i-beam.org>2019-05-21 23:33:31 +0000
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-26 20:52:00 +0900
commit728b0cb35f9e66b7b64ac1c3538b473fc646c15f (patch)
tree56885064b94baa8027968e77edcde916fb09229f /src/background
parent462c67d11352ce6756c2cc47092101d20057f251 (diff)
Fix completion order
Diffstat (limited to 'src/background')
-rw-r--r--src/background/usecases/CompletionsUseCase.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/background/usecases/CompletionsUseCase.ts b/src/background/usecases/CompletionsUseCase.ts
index 705555b..8cd4f32 100644
--- a/src/background/usecases/CompletionsUseCase.ts
+++ b/src/background/usecases/CompletionsUseCase.ts
@@ -38,6 +38,9 @@ export default class CompletionsUseCase {
}
async queryOpen(name: string, keywords: string): Promise<CompletionGroup[]> {
+ // TODO This logic contains view entities. They should be defined on
+ // content script
+
let settings = await this.settingRepository.get();
let groups: CompletionGroup[] = [];
@@ -195,7 +198,7 @@ export default class CompletionsUseCase {
.map(pages => filters.filterByPathname(pages, COMPLETION_ITEM_LIMIT))
.map(pages => filters.filterByOrigin(pages, COMPLETION_ITEM_LIMIT))[0]
.sort((x: HistoryItem, y: HistoryItem): number => {
- return Number(x.visitCount) - Number(y.visitCount);
+ return Number(y.visitCount) - Number(x.visitCount);
})
.slice(0, COMPLETION_ITEM_LIMIT);
return histories.map(page => ({