aboutsummaryrefslogtreecommitdiff
path: root/src/content/operators/impls/EnableAddonOperator.ts
blob: b5b1d7979e387ff8a4e12724ac7d138f93b86a83 (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 EnableAddonOperator implements Operator {
  constructor(
    private readonly indicator: AddonIndicatorClient,
    private readonly repository: AddonEnabledRepository
  ) {}

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