diff options
Diffstat (limited to 'src/background/operators/impls/SelectTabPrevOperator.ts')
-rw-r--r-- | src/background/operators/impls/SelectTabPrevOperator.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/background/operators/impls/SelectTabPrevOperator.ts b/src/background/operators/impls/SelectTabPrevOperator.ts index 93a0d6d..3776c1a 100644 --- a/src/background/operators/impls/SelectTabPrevOperator.ts +++ b/src/background/operators/impls/SelectTabPrevOperator.ts @@ -2,10 +2,7 @@ import Operator from "../Operator"; import TabPresenter from "../../presenters/TabPresenter"; export default class SelectTabPrevOperator 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 SelectTabPrevOperator implements Operator { if (!tab) { return; } - const select = (tab.index - this.count + tabs.length) % tabs.length; + const select = (tab.index - 1 + tabs.length) % tabs.length; return this.tabPresenter.select(tabs[select].id as number); } } |