aboutsummaryrefslogtreecommitdiff
path: root/src/background/controllers/SettingController.ts
blob: 4248746daabd1b7bfb7ec490f220736b88addb79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { injectable } from "tsyringe";
import SettingUseCase from "../usecases/SettingUseCase";
import ContentMessageClient from "../infrastructures/ContentMessageClient";
import Settings from "../../shared/settings/Settings";

@injectable()
export default class SettingController {
  constructor(
    private settingUseCase: SettingUseCase,
    private contentMessageClient: ContentMessageClient
  ) {}

  getSetting(): Promise<Settings> {
    return this.settingUseCase.getCached();
  }

  async reload(): Promise<any> {
    await this.settingUseCase.reload();
    this.contentMessageClient.broadcastSettingsChanged();
  }
}