Skip to content

Commit 843f9a7

Browse files
Closes current window if needed after delete worktree handoff
1 parent c3ae63a commit 843f9a7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/constants.commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export type CoreCommands =
147147
| 'workbench.action.closeActiveEditor'
148148
| 'workbench.action.closeAllEditors'
149149
| 'workbench.action.closePanel'
150+
| 'workbench.action.closeWindow'
150151
| 'workbench.action.focusRightGroup'
151152
| 'workbench.action.nextEditor'
152153
| 'workbench.action.newGroupRight'

src/webviews/home/homeWebview.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,11 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
12411241
'deepLinks:pending',
12421242
JSON.stringify(deleteBranchDeepLink),
12431243
);
1244+
// Close the current window. This should only occur if there was already a different
1245+
// window open for the default worktree.
1246+
setTimeout(() => {
1247+
void executeCoreCommand('workbench.action.closeWindow');
1248+
}, 2000);
12441249
},
12451250
worktreeDefaultOpen: 'current',
12461251
},

0 commit comments

Comments
 (0)