diff options
Diffstat (limited to 'src/settings/actions/setting.js')
-rw-r--r-- | src/settings/actions/setting.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/settings/actions/setting.js b/src/settings/actions/setting.js index 3525f0a..c1b27c8 100644 --- a/src/settings/actions/setting.js +++ b/src/settings/actions/setting.js @@ -3,8 +3,7 @@ import messages from 'shared/messages'; import DefaultSettings from 'shared/default-settings'; const load = () => { - return browser.storage.local.get('settings').then((value) => { - let settings = value.settings; + return browser.storage.local.get('settings').then(({ settings }) => { if (settings) { return set(settings); } @@ -18,6 +17,8 @@ const save = (settings) => { }).then(() => { return browser.runtime.sendMessage({ type: messages.SETTINGS_RELOAD + }).then(() => { + return set(settings); }); }); }; @@ -25,6 +26,7 @@ const save = (settings) => { const set = (settings) => { return { type: actions.SETTING_SET_SETTINGS, + source: settings.source, json: settings.json, value: JSON.parse(settings.json), }; |