aboutsummaryrefslogtreecommitdiff
path: root/src/background/operators/impls/SelectTabNextOperator.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/operators/impls/SelectTabNextOperator.ts')
-rw-r--r--src/background/operators/impls/SelectTabNextOperator.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/background/operators/impls/SelectTabNextOperator.ts b/src/background/operators/impls/SelectTabNextOperator.ts
index 37482fe..34d37ff 100644
--- a/src/background/operators/impls/SelectTabNextOperator.ts
+++ b/src/background/operators/impls/SelectTabNextOperator.ts
@@ -2,10 +2,7 @@ import Operator from "../Operator";
import TabPresenter from "../../presenters/TabPresenter";
export default class SelectTabNextOperator implements Operator {
- constructor(
- private readonly tabPresenter: TabPresenter,
- private readonly count: number
- ) {}
+ constructor(private readonly tabPresenter: TabPresenter) {}
async run(): Promise<void> {
const tabs = await this.tabPresenter.getAll();
@@ -16,7 +13,7 @@ export default class SelectTabNextOperator implements Operator {
if (!tab) {
return;
}
- const select = (tab.index + this.count) % tabs.length;
+ const select = (tab.index + 1) % tabs.length;
return this.tabPresenter.select(tabs[select].id as number);
}
}