aboutsummaryrefslogtreecommitdiff
path: root/src/content/operators/impls/DisableAddonOperator.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/operators/impls/DisableAddonOperator.ts')
-rw-r--r--src/content/operators/impls/DisableAddonOperator.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/content/operators/impls/DisableAddonOperator.ts b/src/content/operators/impls/DisableAddonOperator.ts
new file mode 100644
index 0000000..28811fe
--- /dev/null
+++ b/src/content/operators/impls/DisableAddonOperator.ts
@@ -0,0 +1,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);
+ }
+}