diff options
Diffstat (limited to 'src/content/usecases/AddonEnabledUseCase.ts')
-rw-r--r-- | src/content/usecases/AddonEnabledUseCase.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/content/usecases/AddonEnabledUseCase.ts b/src/content/usecases/AddonEnabledUseCase.ts index f7e78c5..b45c47f 100644 --- a/src/content/usecases/AddonEnabledUseCase.ts +++ b/src/content/usecases/AddonEnabledUseCase.ts @@ -1,15 +1,17 @@ import { injectable, inject } from "tsyringe"; import AddonIndicatorClient from "../client/AddonIndicatorClient"; import AddonEnabledRepository from "../repositories/AddonEnabledRepository"; +import ConsoleFramePresenter from "../presenters/ConsoleFramePresenter"; @injectable() export default class AddonEnabledUseCase { constructor( @inject("AddonIndicatorClient") - private indicator: AddonIndicatorClient, - + private readonly indicator: AddonIndicatorClient, @inject("AddonEnabledRepository") - private repository: AddonEnabledRepository + private readonly repository: AddonEnabledRepository, + @inject("ConsoleFramePresenter") + private readonly consoleFramePresenter: ConsoleFramePresenter ) {} async enable(): Promise<void> { @@ -31,6 +33,12 @@ export default class AddonEnabledUseCase { private async setEnabled(on: boolean): Promise<void> { this.repository.set(on); + + if (on) { + this.consoleFramePresenter.attach(); + } else { + this.consoleFramePresenter.detach(); + } await this.indicator.setEnabled(on); } } |