aboutsummaryrefslogtreecommitdiff
path: root/src/content/operators/impls/DisableAddonOperator.ts
blob: 28811fe1eee17e16d05257006c46d918a40cfd3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Operator from "../Operator";
import AddonIndicatorClient from "../../client/AddonIndicatorClient";
import AddonEnabledRepository from "../../repositories/AddonEnabledRepository";

export default class DisableAddonOperator implements Operator {
  constructor(
    private readonly indicator: AddonIndicatorClient,
    private readonly repository: AddonEnabledRepository
  ) {}

  async run(): Promise<void> {
    this.repository.set(false);
    await this.indicator.setEnabled(false);
  }
}