aboutsummaryrefslogtreecommitdiff
path: root/src/background/operators/impls/NavigateHistoryPrevOperator.ts
blob: 27d4ee92ff180dc9a2a4185f54e96c281b0077fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Operator from "../Operator";
import TabPresenter from "../../presenters/TabPresenter";
import NavigateClient from "../../clients/NavigateClient";

export default class NavigateHistoryPrevOperator implements Operator {
  constructor(
    private readonly tabPresenter: TabPresenter,
    private readonly navigateClient: NavigateClient
  ) {}

  async run(): Promise<void> {
    const tab = await this.tabPresenter.getCurrent();
    await this.navigateClient.historyPrev(tab.id!);
  }
}