aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/PersistentSettingRepository.ts
blob: e3b78b3cc39ec83e7e30ec3509d19014fb13c04c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { injectable } from 'tsyringe';
import SettingData from '../../shared/SettingData';

@injectable()
export default class SettingRepository {
  async load(): Promise<SettingData | null> {
    let { settings } = await browser.storage.local.get('settings');
    if (!settings) {
      return null;
    }
    return SettingData.fromJSON(settings as any);
  }
}