Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): a refused review shows GitHub's reason #22382

Mergedtiliakoos(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/22382/headmerged by maria-rcks View on GitHub

Showing 1 changed file with 10 additions and 1 deletion.

x
0 of 1 viewed, 1 left
10 additions and 1 deletionapps/web/src/components/pullRequest/PullRequestReviewForm.tsxModified
View file
@@ -4,11 +4,13 @@
import { useState, type ReactNode, type RefObject } from "react";
​
import { pullRequestEnvironment } from "~/state/pullRequests";
+import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
​
import { Button } from "../ui/button";
import { Select, SelectItem, SelectPopup, SelectTrigger } from "../ui/select";
import { Textarea } from "../ui/textarea";
import { toastManager } from "../ui/toast";
+import { readableFailure } from "./pullRequestDetail.logic";
import {
pullRequestReviewKey,
usePendingReviewComments,
@@ -94,7 +96,14 @@
});
onPendingChange(false);
if (result._tag === "Failure") {
- toastManager.add({ type: "error", title: "The review could not be submitted" });
+ toastManager.add({
+ type: "error",
+ title: "The review could not be submitted",
+ description: readableFailure(
+ squashAtomCommandFailure(result),
+ "The host refused the review. Your draft is still here to try again.",
+ ),
+ });
return;