diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 65db68e7f8..78b8326af5 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -297,13 +297,13 @@ function SidebarThreadRow(props: SidebarThreadRowProps) { (state) => selectThreadTerminalState(state.terminalStateByThreadId, props.threadId).runningTerminalIds, ); + const gitCwd = thread?.worktreePath ?? props.projectCwd; + const gitStatus = useGitStatus(thread?.branch !== null ? gitCwd : null); if (!thread) { return null; } - const gitCwd = thread.worktreePath ?? props.projectCwd; - const gitStatus = useGitStatus(thread.branch !== null ? gitCwd : null); const isActive = props.routeThreadId === thread.id; const isSelected = props.selectedThreadIds.has(thread.id); const isHighlighted = isActive || isSelected;