aboutsummaryrefslogtreecommitdiff
path: root/src/background/operators/impls/ToggleReaderOperator.ts
blob: 681e4c319ab898aa6804c4b0ebc49f26ae430c2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import Operator from "../Operator";
import TabPresenter from "../../presenters/TabPresenter";

export default class ToggleReaderOperator implements Operator {
  constructor(private readonly tabPresenter: TabPresenter) {}

  async run(): Promise<void> {
    const tab = await this.tabPresenter.getCurrent();
    return this.tabPresenter.toggleReaderMode(tab.id as number);
  }
}