Skip to content

Commit e638bb7

Browse files
sallyomclaude
andcommitted
fix: TypeScript error in branch name lookup for dropdown
Fixed type error by separating the lookup of realtimeRepo (RepoStatus) and reconciledRepo (ReconciledRepo) to avoid accessing .branch property on a union type where one variant doesn't have that property. Now properly checks realtimeRepo.currentActiveBranch first, then falls back to reconciledRepo.currentActiveBranch, and finally to the deprecated reconciledRepo.branch property. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9412ff1 commit e638bb7

File tree

1 file changed

+10
-4
lines changed
  • components/frontend/src/app/projects/[name]/sessions/[sessionName]

1 file changed

+10
-4
lines changed

components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,16 +1661,22 @@ export default function ProjectSessionDetailPage({
16611661
// Find branch info for repo directories from real-time status
16621662
let branchName: string | undefined;
16631663
if (opt.type === "repo") {
1664-
// Try real-time repos status first, then fall back to CR status
1665-
const repo = reposStatus?.repos?.find(
1664+
// Try real-time repos status first
1665+
const realtimeRepo = reposStatus?.repos?.find(
16661666
(r) => r.name === opt.path
1667-
) || session?.status?.reconciledRepos?.find(
1667+
);
1668+
1669+
// Fall back to CR status
1670+
const reconciledRepo = session?.status?.reconciledRepos?.find(
16681671
(r: ReconciledRepo) => {
16691672
const repoName = r.name || r.url?.split("/").pop()?.replace(".git", "");
16701673
return opt.path === repoName;
16711674
}
16721675
);
1673-
branchName = repo?.currentActiveBranch || repo?.branch;
1676+
1677+
branchName = realtimeRepo?.currentActiveBranch
1678+
|| reconciledRepo?.currentActiveBranch
1679+
|| reconciledRepo?.branch;
16741680
}
16751681

16761682
return (

0 commit comments

Comments
 (0)