fix(web): links to issues no longer strand the pull request viewer (#14242)
This commit is contained in:
1 parent
2b8bb0c188
commit
7bc161f869
12 files changed
+73
-6
No files matched your search
@@ -144,6 +144,7 @@ import {
|
||||
handoffReviewComments,
|
||||
latestPullRequestReviewOutcomes,
|
||||
loadingPullRequestCheckoutCommand,
|
||||
isPullRequestNotFound,
|
||||
isStackedPullRequestBase,
|
||||
pullRequestActionMenuHasGroup,
|
||||
pullRequestActionNeedsHostRefresh,
|
||||
@@ -2719,7 +2720,13 @@ export function PullRequestDetailPanel({
|
||||
>
|
||||
{detailQuery.error && !detail ? (
|
||||
<PullRequestsUnavailableState
|
||||
error={detailQuery.error}
|
||||
{...(isPullRequestNotFound(detailQuery.failure)
|
||||
? {
|
||||
title: `Pull request #${reference.number} not found`,
|
||||
error:
|
||||
"It may be an issue rather than a pull request, or this account can't see it.",
|
||||
}
|
||||
: { error: detailQuery.error })}
|
||||
refreshing={detailQuery.isPending}
|
||||
onRetry={refreshDetail}
|
||||
{...(unavailableGitHubUrl ? { gitHubUrl: unavailableGitHubUrl } : {})}
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as Schema from "effect/Schema";
|
||||
|
||||
import {
|
||||
PullRequestDetail,
|
||||
PullRequestOperationError,
|
||||
pullRequestHostOf,
|
||||
type PullRequestAction,
|
||||
type PullRequestActor,
|
||||
@@ -1161,6 +1162,12 @@ export function buildAddSelectionToAgentHandoff(input: {
|
||||
};
|
||||
}
|
||||
|
||||
const isPullRequestOperationError = Schema.is(PullRequestOperationError);
|
||||
|
||||
export function isPullRequestNotFound(failure: unknown): boolean {
|
||||
return isPullRequestOperationError(failure) && failure.reason === "not-found";
|
||||
}
|
||||
|
||||
/**
|
||||
* The internal wrapper every failed operation arrives in: which operation ran, and which tool
|
||||
* said no. A reader has no use for either.
|
||||
|
||||
Reference in new issue
Block a user