Skip to content

Commit 9281a6a

Browse files
fix(prs): wait for a successful stack lookup before single merges
1 parent 79e2a04 commit 9281a6a

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ export function PullRequestDetailPanel({
747747
const canMergeSinglePullRequest = allowsSinglePullRequestMerge({
748748
supportsStackActions,
749749
hasStack: nativeStack !== null,
750-
stackPending: nativeStackQuery.isPending,
750+
stackPending: !nativeStackQuery.isSuccess || nativeStackQuery.isPending,
751751
stackError: nativeStackQuery.error,
752752
});
753753
const activityPending = activityQuery.isPending && activity === null;

‎apps/web/src/state/query.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface EnvironmentQueryView<A> {
1111
readonly data: A | null;
1212
readonly error: string | null;
1313
readonly isPending: boolean;
14+
readonly isSuccess: boolean;
1415
readonly refresh: () => void;
1516
}
1617

@@ -31,6 +32,7 @@ export function useEnvironmentQuery<A, E>(
3132
data: Option.getOrNull(AsyncResult.value(result)),
3233
error: result._tag === "Failure" ? formatEnvironmentQueryError(result.cause) : null,
3334
isPending: atom !== null && result.waiting,
35+
isSuccess: result._tag === "Success",
3436
refresh,
3537
};
3638
}

0 commit comments

Comments
 (0)