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

export default class ReloadTabOperator implements Operator {
  constructor(
    private readonly tabPresenter: TabPresenter,
    private readonly cache: boolean
  ) {}

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