fix(web): hide back button for single linked pull requests (#11520)
This commit is contained in:
1 parent
46140c96af
commit
2ec59ca1fa
1 file changed
+5
-4
@@ -4228,10 +4228,11 @@ export default function ChatView(props: ChatViewProps) {
|
||||
}, [activeThreadRef]);
|
||||
const supportsThreadPullRequests =
|
||||
serverConfig?.environment.capabilities.threadPullRequests === true;
|
||||
const visiblePullRequestCount = visibleThreadPullRequests(
|
||||
(activeThreadShell ?? activeThread)?.pullRequests ?? [],
|
||||
).length;
|
||||
const pullRequestsSurfaceAvailable =
|
||||
isServerThread &&
|
||||
supportsThreadPullRequests &&
|
||||
visibleThreadPullRequests((activeThreadShell ?? activeThread)?.pullRequests ?? []).length > 0;
|
||||
isServerThread && supportsThreadPullRequests && visiblePullRequestCount > 0;
|
||||
const addPullRequestsSurface = useCallback(() => {
|
||||
if (!activeThreadRef || !pullRequestsSurfaceAvailable) return;
|
||||
useRightPanelStore.getState().open(activeThreadRef, "pull-requests");
|
||||
@@ -8544,7 +8545,7 @@ export default function ChatView(props: ChatViewProps) {
|
||||
}
|
||||
composerDraftTarget={composerDraftTarget}
|
||||
onBack={
|
||||
activeThreadRef !== null && pullRequestsSurfaceAvailable
|
||||
activeThreadRef !== null && pullRequestsSurfaceAvailable && visiblePullRequestCount > 1
|
||||
? addPullRequestsSurface
|
||||
: undefined
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user