aboutsummaryrefslogtreecommitdiff
path: root/src/background/index.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-22 09:30:01 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-07-22 09:30:01 +0900
commit87ed1f43a96a67c4901c267aee96784de1d45889 (patch)
tree0ef3182973cad8b54a562cd9e1a34763ea5320c0 /src/background/index.js
parenta1e5e97200bd96ba918744dfa2758f977ca823c6 (diff)
Version as Clean Architecture
Diffstat (limited to 'src/background/index.js')
-rw-r--r--src/background/index.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/background/index.js b/src/background/index.js
index 69dbe06..e753c48 100644
--- a/src/background/index.js
+++ b/src/background/index.js
@@ -5,25 +5,16 @@ import IndicatorComponent from 'background/components/indicator';
import reducers from 'background/reducers';
import { createStore, applyMiddleware } from 'redux';
import promise from 'redux-promise';
-import * as versions from './shared/versions';
import ContentMessageListener from './infrastructures/content-message-listener';
import SettingController from './controllers/setting';
+import VersionRepository from './controllers/version';
const store = createStore(
reducers,
applyMiddleware(promise),
);
-const checkAndNotifyUpdated = async() => {
- let updated = await versions.checkUpdated();
- if (!updated) {
- return;
- }
- await versions.notify();
- await versions.commit();
-};
-
/* eslint-disable no-unused-vars */
const backgroundComponent = new BackgroundComponent(store);
const operationComponent = new OperationComponent(store);
@@ -31,8 +22,7 @@ const tabComponent = new TabComponent(store);
const indicatorComponent = new IndicatorComponent(store);
/* eslint-enable no-unused-vars */
-checkAndNotifyUpdated();
-
new SettingController().reload();
+new VersionRepository().notifyIfUpdated();
new ContentMessageListener().run();