Guard orphaned worktree deletion behind project context
- Require both orphaned worktree path and thread project before prompting delete - Prevents delete confirmation when project metadata is unavailable
This commit is contained in:
1 parent
4f5eb3be4d
commit
293f7b1507
1 file changed
+2
-1
@@ -268,8 +268,9 @@ export default function Sidebar() {
|
||||
const displayWorktreePath = orphanedWorktreePath
|
||||
? formatWorktreePathForDisplay(orphanedWorktreePath)
|
||||
: null;
|
||||
const canDeleteWorktree = orphanedWorktreePath !== null && threadProject !== undefined;
|
||||
const shouldDeleteWorktree =
|
||||
orphanedWorktreePath !== null &&
|
||||
canDeleteWorktree &&
|
||||
(await api.dialogs.confirm(
|
||||
[
|
||||
"This thread is the only one linked to this worktree:",
|
||||
|
||||
Reference in new issue
Block a user