Keep SidebarThreadRow hooks ordered before early return
- Compute git status inputs before the null guard - Preserve hook order while rendering thread rows
This commit is contained in:
1 parent
366182e825
commit
8b9304ca7c
1 file changed
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user