aboutsummaryrefslogtreecommitdiff
path: root/src/settings/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/actions')
-rw-r--r--src/settings/actions/setting.js7
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),
};
};