diff options
Diffstat (limited to 'src/settings')
-rw-r--r-- | src/settings/actions/setting.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/settings/actions/setting.js b/src/settings/actions/setting.js index 92c9f8a..1219ba5 100644 --- a/src/settings/actions/setting.js +++ b/src/settings/actions/setting.js @@ -4,20 +4,17 @@ import DefaultSettings from 'shared/settings/default'; import * as settingsStorage from 'shared/settings/storage'; import * as settingsValues from 'shared/settings/values'; -const load = () => { - return settingsStorage.loadRaw().then((settings) => { - return set(settings); - }); +const load = async() => { + let settings = await settingsStorage.loadRaw(); + return set(settings); }; -const save = (settings) => { - return settingsStorage.save(settings).then(() => { - return browser.runtime.sendMessage({ - type: messages.SETTINGS_RELOAD - }); - }).then(() => { - return set(settings); +const save = async(settings) => { + await settingsStorage.save(settings); + await browser.runtime.sendMessage({ + type: messages.SETTINGS_RELOAD }); + return set(settings); }; const set = (settings) => { |