diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-09 17:35:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-09 17:35:10 +0900 |
commit | 447466808f484d4baa6b285f2dbcaf1920db5498 (patch) | |
tree | aba110eb78b4ce3eb6cefb8100f167e17a23fcc3 /src/background | |
parent | 892eb8a6a6d9080213f461f19a8b8435a6482237 (diff) | |
parent | 805d1395fc869235f079438b5b4884a521c0230e (diff) |
Merge pull request #27 from ueokande/react-settings
Use React in settings
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/actions/settings.js | 0 | ||||
-rw-r--r-- | src/background/components/background.js | 12 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/background/actions/settings.js b/src/background/actions/settings.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/background/actions/settings.js diff --git a/src/background/components/background.js b/src/background/components/background.js index 0570a5a..06b6900 100644 --- a/src/background/components/background.js +++ b/src/background/components/background.js @@ -22,15 +22,7 @@ export default class BackgroundComponent { } update() { - let state = this.store.getState(); - this.updateSettings(state); - } - - updateSettings(setting) { - if (!setting.settings.json) { - return; - } - this.settings = JSON.parse(setting.settings.json); + this.settings = this.store.getState(); } onMessage(message, sender) { @@ -58,7 +50,7 @@ export default class BackgroundComponent { }); }); case messages.SETTINGS_QUERY: - return Promise.resolve(this.store.getState().settings); + return Promise.resolve(this.store.getState().value); case messages.CONSOLE_QUERY_COMPLETIONS: return commands.complete(message.text, this.settings); case messages.SETTINGS_RELOAD: |