diff options
Diffstat (limited to 'src/background/usecases/TabUseCase.ts')
-rw-r--r-- | src/background/usecases/TabUseCase.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/background/usecases/TabUseCase.ts b/src/background/usecases/TabUseCase.ts index 31112a9..386307e 100644 --- a/src/background/usecases/TabUseCase.ts +++ b/src/background/usecases/TabUseCase.ts @@ -12,11 +12,15 @@ export default class TabUseCase { ) { } - async close(force: boolean): Promise<any> { + async close(force: boolean, selectLeft = false): Promise<any> { let tab = await this.tabPresenter.getCurrent(); if (!force && tab.pinned) { return Promise.resolve(); } + if (selectLeft && tab.index > 0) { + let tabs = await this.tabPresenter.getAll(); + await this.tabPresenter.select(tabs[tab.index - 1].id as number); + } return this.tabPresenter.remove([tab.id as number]); } |