|
|
@ -4,20 +4,17 @@ import DefaultSettings from 'shared/settings/default'; |
|
|
|
import * as settingsStorage from 'shared/settings/storage'; |
|
|
|
import * as settingsStorage from 'shared/settings/storage'; |
|
|
|
import * as settingsValues from 'shared/settings/values'; |
|
|
|
import * as settingsValues from 'shared/settings/values'; |
|
|
|
|
|
|
|
|
|
|
|
const load = () => { |
|
|
|
const load = async() => { |
|
|
|
return settingsStorage.loadRaw().then((settings) => { |
|
|
|
let settings = await settingsStorage.loadRaw(); |
|
|
|
return set(settings); |
|
|
|
return set(settings); |
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const save = (settings) => { |
|
|
|
const save = async(settings) => { |
|
|
|
return settingsStorage.save(settings).then(() => { |
|
|
|
await settingsStorage.save(settings); |
|
|
|
return browser.runtime.sendMessage({ |
|
|
|
await browser.runtime.sendMessage({ |
|
|
|
type: messages.SETTINGS_RELOAD |
|
|
|
type: messages.SETTINGS_RELOAD |
|
|
|
}); |
|
|
|
}); |
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
return set(settings); |
|
|
|
return set(settings); |
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const set = (settings) => { |
|
|
|
const set = (settings) => { |
|
|
|