| ... | ... | @@ -4228,10 +4228,11 @@ export default function ChatView(props: ChatViewProps) { |
| 4228 | 4228 | }, [activeThreadRef]); |
| 4229 | 4229 | const supportsThreadPullRequests = |
| 4230 | 4230 | serverConfig?.environment.capabilities.threadPullRequests === true; |
| 4231 | const visiblePullRequestCount = visibleThreadPullRequests( |
| 4232 | (activeThreadShell ?? activeThread)?.pullRequests ?? [], |
| 4233 | ).length; |
| 4231 | 4234 | const pullRequestsSurfaceAvailable = |
| 4232 | | isServerThread && |
| 4233 | | supportsThreadPullRequests && |
| 4234 | | visibleThreadPullRequests((activeThreadShell ?? activeThread)?.pullRequests ?? []).length > 0; |
| 4235 | isServerThread && supportsThreadPullRequests && visiblePullRequestCount > 0; |
| 4235 | 4236 | const addPullRequestsSurface = useCallback(() => { |
| 4236 | 4237 | if (!activeThreadRef || !pullRequestsSurfaceAvailable) return; |
| 4237 | 4238 | useRightPanelStore.getState().open(activeThreadRef, "pull-requests"); |
| ... | ... | @@ -8544,7 +8545,7 @@ export default function ChatView(props: ChatViewProps) { |
| 8544 | 8545 | } |
| 8545 | 8546 | composerDraftTarget={composerDraftTarget} |
| 8546 | 8547 | onBack={ |
| 8547 | | activeThreadRef !== null && pullRequestsSurfaceAvailable |
| 8548 | activeThreadRef !== null && pullRequestsSurfaceAvailable && visiblePullRequestCount > 1 |
| 8548 | 8549 | ? addPullRequestsSurface |
| 8549 | 8550 | : undefined |
| 8550 | 8551 | } |