Skip to content

Commit c68fbc2

Browse files
authored
Merge pull request #1669 from kleros/fix/appeal-fund-flow
fix(web): appeal-fund-post-txn-flow
2 parents d1fef37 + b2bf99d commit c68fbc2

File tree

1 file changed

+5
-5
lines changed
  • web/src/pages/Cases/CaseDetails/Appeal/Classic

1 file changed

+5
-5
lines changed

web/src/pages/Cases/CaseDetails/Appeal/Classic/Fund.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ const useFundAppeal = (parsedAmount) => {
7070
value: parsedAmount,
7171
});
7272

73-
const { writeContractAsync } = useWriteDisputeKitClassicFundAppeal();
73+
const { writeContractAsync: fundAppeal } = useWriteDisputeKitClassicFundAppeal();
7474

75-
return { fundAppeal: async () => await writeContractAsync(fundAppealConfig.request), isError };
75+
return { fundAppeal, fundAppealConfig, isError };
7676
};
7777

7878
interface IFund {
@@ -98,7 +98,7 @@ const Fund: React.FC<IFund> = ({ amount, setAmount, setIsOpen }) => {
9898

9999
const parsedAmount = useParsedAmount(debouncedAmount as `${number}`);
100100

101-
const { fundAppeal, isError } = useFundAppeal(parsedAmount);
101+
const { fundAppealConfig, fundAppeal, isError } = useFundAppeal(parsedAmount);
102102

103103
const isFundDisabled = useMemo(
104104
() =>
@@ -123,9 +123,9 @@ const Fund: React.FC<IFund> = ({ amount, setAmount, setIsOpen }) => {
123123
isLoading={isSending}
124124
text={isDisconnected ? "Connect to Fund" : "Fund"}
125125
onClick={() => {
126-
if (fundAppeal) {
126+
if (fundAppeal && fundAppealConfig && publicClient) {
127127
setIsSending(true);
128-
wrapWithToast(async () => await fundAppeal().then((response) => response.hash), publicClient)
128+
wrapWithToast(async () => await fundAppeal(fundAppealConfig.request), publicClient)
129129
.then((res) => {
130130
res.status && setIsOpen(true);
131131
})

0 commit comments

Comments
 (0)