diff options
Diffstat (limited to 'src/background/index.js')
-rw-r--r-- | src/background/index.js | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/background/index.js b/src/background/index.js index 1e4c078..30007a9 100644 --- a/src/background/index.js +++ b/src/background/index.js @@ -1,34 +1,8 @@ -import * as settingActions from 'background/actions/setting'; -import BackgroundComponent from 'background/components/background'; -import OperationComponent from 'background/components/operation'; -import TabComponent from 'background/components/tab'; -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 VersionController from './controllers/version'; -const store = createStore( - reducers, - applyMiddleware(promise), -); +new SettingController().reload(); +new VersionController().notifyIfUpdated(); -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); -const tabComponent = new TabComponent(store); -const indicatorComponent = new IndicatorComponent(store); -/* eslint-enable no-unused-vars */ - -store.dispatch(settingActions.load()); - -checkAndNotifyUpdated(); +new ContentMessageListener().run(); |