Skip to content

Commit

Permalink
Merge pull request #223 from WTFAcademy/dev
Browse files Browse the repository at this point in the history
Fix: fix error message content and add an error about insufficient funds.
  • Loading branch information
AmazingAng authored Jul 31, 2024
2 parents 40efd86 + 2ba2d82 commit c481992
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hooks/useMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const ErrorMap = message => {
return "拒绝交易";
}

if (message.includes("insufficient funds")) {
return "余额不足";
}

return "领取错误,请重试";
};

Expand Down Expand Up @@ -86,7 +90,7 @@ const useMint = (onSuccess = () => {}) => {
console.log(e);
setLoading(false);
setError(true);
setErrorMessage(ErrorMap(String(e.message)));
setErrorMessage(ErrorMap(String(e.data.message)));
}
};

Expand Down

0 comments on commit c481992

Please sign in to comment.