aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/PersistentSettingRepository.ts
blob: c10f2cf081eb78ba1ec9054aebce6a327ffef9ec (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> {
    const { settings } = await browser.storage.local.get('settings');
    if (!settings) {
      return null;
    }
    return SettingData.fromJSON(settings as any);
  }
}