Skip to content

Commit 8b143c4

Browse files
committed
fix(web): hide back button for single linked pull requests
1 parent 0c5771d commit 8b143c4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,10 +4228,11 @@ export default function ChatView(props: ChatViewProps) {
42284228
}, [activeThreadRef]);
42294229
const supportsThreadPullRequests =
42304230
serverConfig?.environment.capabilities.threadPullRequests === true;
4231+
const visiblePullRequestCount = visibleThreadPullRequests(
4232+
(activeThreadShell ?? activeThread)?.pullRequests ?? [],
4233+
).length;
42314234
const pullRequestsSurfaceAvailable =
4232-
isServerThread &&
4233-
supportsThreadPullRequests &&
4234-
visibleThreadPullRequests((activeThreadShell ?? activeThread)?.pullRequests ?? []).length > 0;
4235+
isServerThread && supportsThreadPullRequests && visiblePullRequestCount > 0;
42354236
const addPullRequestsSurface = useCallback(() => {
42364237
if (!activeThreadRef || !pullRequestsSurfaceAvailable) return;
42374238
useRightPanelStore.getState().open(activeThreadRef, "pull-requests");
@@ -8544,7 +8545,7 @@ export default function ChatView(props: ChatViewProps) {
85448545
}
85458546
composerDraftTarget={composerDraftTarget}
85468547
onBack={
8547-
activeThreadRef !== null && pullRequestsSurfaceAvailable
8548+
activeThreadRef !== null && pullRequestsSurfaceAvailable && visiblePullRequestCount > 1
85488549
? addPullRequestsSurface
85498550
: undefined
85508551
}

0 commit comments

Comments
 (0)