Skip to content

Commit 717c417

Browse files
fix(web): keep interrupted checkout errors readable
1 parent d7647f0 commit 717c417

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import {
88
scopeProjectRef,
99
scopeThreadRef,
1010
} from "@t3tools/client-runtime/environment";
11-
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
11+
import {
12+
isAtomCommandInterrupted,
13+
squashAtomCommandFailure,
14+
} from "@t3tools/client-runtime/state/runtime";
1215
import {
1316
AuthOrchestrationOperateScope,
1417
AuthSourceControlWriteScope,
@@ -1218,7 +1221,9 @@ export function PullRequestDetailPanel({
12181221
toastManager.update(toastId, {
12191222
type: "error",
12201223
title: "Could not prepare the pull request checkout",
1221-
description: checkoutFailureDescription(squashAtomCommandFailure(prepared)),
1224+
description: checkoutFailureDescription(
1225+
isAtomCommandInterrupted(prepared) ? undefined : squashAtomCommandFailure(prepared),
1226+
),
12221227
});
12231228
return;
12241229
}

‎apps/web/src/components/pullRequest/usePullRequestActions.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { useAtomCommand } from "~/state/use-atom-command";
22
import { scopeProjectRef } from "@t3tools/client-runtime/environment";
3-
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
3+
import {
4+
isAtomCommandInterrupted,
5+
squashAtomCommandFailure,
6+
} from "@t3tools/client-runtime/state/runtime";
47
import type {
58
EnvironmentId,
69
ProjectId,
@@ -345,7 +348,9 @@ export function usePullRequestHandoffs({
345348
toastManager.update(toastId, {
346349
type: "error",
347350
title: "Could not prepare the pull request checkout",
348-
description: checkoutFailureDescription(squashAtomCommandFailure(prepared)),
351+
description: checkoutFailureDescription(
352+
isAtomCommandInterrupted(prepared) ? undefined : squashAtomCommandFailure(prepared),
353+
),
349354
});
350355
return;
351356
}

0 commit comments

Comments
 (0)