diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index ae2b6fb66ae0c16c8df64aad4f91fbe0479b67fe..3b2382f9474c6a94984bfee21e3daecc7f85a6e0 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -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:",