diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-11-22 22:38:34 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-11-26 11:40:12 +0900 |
commit | 4e5ddc1d57ba4f42314eb49ae57a9b67950be596 (patch) | |
tree | c43db0b38d030446cbbde392d63cd7faf2d6f533 /src/settings/actions | |
parent | d33b37cdb9d2956f5f2d23ab4e71e35db137b16e (diff) |
Add keybindings form
Diffstat (limited to 'src/settings/actions')
-rw-r--r-- | src/settings/actions/setting.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/settings/actions/setting.js b/src/settings/actions/setting.js index c1b27c8..fa158a3 100644 --- a/src/settings/actions/setting.js +++ b/src/settings/actions/setting.js @@ -4,10 +4,10 @@ import DefaultSettings from 'shared/default-settings'; const load = () => { return browser.storage.local.get('settings').then(({ settings }) => { - if (settings) { - return set(settings); + if (!settings) { + return set(DefaultSettings); } - return set(DefaultSettings); + return set(Object.assign({}, DefaultSettings, settings)); }, console.error); }; @@ -28,6 +28,7 @@ const set = (settings) => { type: actions.SETTING_SET_SETTINGS, source: settings.source, json: settings.json, + form: settings.form, value: JSON.parse(settings.json), }; }; |