Skip to content

Commit 1de72b6

Browse files
committed
fix: fall back to threadRef when draftId is absent in BranchToolbar
When BranchToolbar is rendered for a draft thread without a draftId prop, selecting a branch silently discarded the user's selection due to an early return guard. Restore the original behavior by falling back to threadRef (which is always available) when draftId is not provided.
1 parent c1e7216 commit 1de72b6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

apps/web/src/components/BranchToolbar.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ export default function BranchToolbar({
105105
currentWorktreePath: activeWorktreePath,
106106
effectiveEnvMode,
107107
});
108-
if (!draftId) {
109-
return;
110-
}
111-
setDraftThreadContext(draftId, {
108+
setDraftThreadContext(draftId ?? threadRef, {
112109
branch,
113110
worktreePath,
114111
envMode: nextDraftEnvMode,
@@ -124,6 +121,7 @@ export default function BranchToolbar({
124121
setThreadBranchAction,
125122
setDraftThreadContext,
126123
draftId,
124+
threadRef,
127125
environmentId,
128126
effectiveEnvMode,
129127
],

0 commit comments

Comments
 (0)