aboutsummaryrefslogtreecommitdiff
path: root/src/background/Application.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-02-03 12:11:17 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2020-02-03 14:26:56 +0900
commit02e8b55884fd530dee03613d79adad8aa9180b61 (patch)
tree7379e14ef3da8164c6af806aba2dbe7f40c4927a /src/background/Application.ts
parent23c59c9747f83d70df6fc630b1ce99639029dbe7 (diff)
Rename setting repositories and refactor
Diffstat (limited to 'src/background/Application.ts')
-rw-r--r--src/background/Application.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/background/Application.ts b/src/background/Application.ts
index 08013cd..d5e7a67 100644
--- a/src/background/Application.ts
+++ b/src/background/Application.ts
@@ -2,6 +2,7 @@ import { injectable } from 'tsyringe';
import ContentMessageListener from './infrastructures/ContentMessageListener';
import SettingController from './controllers/SettingController';
import VersionController from './controllers/VersionController';
+import LocalSettingRepository from "./repositories/LocalSettingRepository";
@injectable()
export default class Application {
@@ -9,6 +10,7 @@ export default class Application {
private contentMessageListener: ContentMessageListener,
private settingController: SettingController,
private versionController: VersionController,
+ private localSettingRepository: LocalSettingRepository
) {
}
@@ -23,13 +25,8 @@ export default class Application {
});
this.contentMessageListener.run();
- browser.storage.onChanged.addListener((changes, area) => {
- if (area !== 'local') {
- return;
- }
- if (changes.settings) {
- this.settingController.reload();
- }
+ this.localSettingRepository.onChange(() => {
+ this.settingController.reload();
});
}
}