aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/CompletionsUseCase.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/usecases/CompletionsUseCase.ts')
-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 => ({