blob: 748b9ab64e936c4087046cd876af3fbc09b4fef0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import SettingData, { DefaultSettingData } from '../shared/SettingData';
export const load = async(): Promise<SettingData> => {
let { settings } = await browser.storage.local.get('settings');
if (!settings) {
return DefaultSettingData;
}
return SettingData.valueOf(settings);
};
export const save = (data: SettingData) => {
return browser.storage.local.set({
settings: data.toJSON(),
});
};
|