aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/CompletionsUseCase.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-02-09 13:43:37 +0900
committerGitHub <noreply@github.com>2020-02-09 13:43:37 +0900
commite9f81d2e2494396bc9ebd827ab02aa8128f1a3ac (patch)
treec6382665c547443358163cb7cbaeeaba52d688b3 /src/background/usecases/CompletionsUseCase.ts
parent8b9388f6e60fe67d20638f55aecb0ed1b281871a (diff)
parentb2fc46ebf79ebb1ffa068fb513d1eeb9b50d7b3f (diff)
Merge pull request #708 from ueokande/sync-storage
Synchronize settings with Firefox Sync
Diffstat (limited to 'src/background/usecases/CompletionsUseCase.ts')
-rw-r--r--src/background/usecases/CompletionsUseCase.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/background/usecases/CompletionsUseCase.ts b/src/background/usecases/CompletionsUseCase.ts
index 779c61d..9874644 100644
--- a/src/background/usecases/CompletionsUseCase.ts
+++ b/src/background/usecases/CompletionsUseCase.ts
@@ -1,9 +1,9 @@
-import { injectable } from 'tsyringe';
+import { injectable, inject } from 'tsyringe';
import CompletionGroup from '../domains/CompletionGroup';
import CommandDocs from '../domains/CommandDocs';
import CompletionsRepository from '../repositories/CompletionsRepository';
import * as filters from './filters';
-import SettingRepository from '../repositories/SettingRepository';
+import CachedSettingRepository from '../repositories/CachedSettingRepository';
import TabPresenter from '../presenters/TabPresenter';
import Properties from '../../shared/settings/Properties';
@@ -17,7 +17,7 @@ export default class CompletionsUseCase {
constructor(
private tabPresenter: TabPresenter,
private completionsRepository: CompletionsRepository,
- private settingRepository: SettingRepository,
+ @inject("CachedSettingRepository") private cachedSettingRepository: CachedSettingRepository,
) {
}
@@ -41,7 +41,7 @@ export default class CompletionsUseCase {
// TODO This logic contains view entities. They should be defined on
// content script
- const settings = await this.settingRepository.get();
+ const settings = await this.cachedSettingRepository.get();
const groups: CompletionGroup[] = [];
const complete = settings.properties.complete;
@@ -180,7 +180,7 @@ export default class CompletionsUseCase {
}
async querySearchEngineItems(name: string, keywords: string) {
- const settings = await this.settingRepository.get();
+ const settings = await this.cachedSettingRepository.get();
const engines = Object.keys(settings.search.engines)
.filter(key => key.startsWith(keywords));
return engines.map(key => ({