Skip to content

Commit

Permalink
Fix: fix error message content and add an error about insufficient fu…
Browse files Browse the repository at this point in the history
…nds.
  • Loading branch information
Glacier-Luo committed Jul 31, 2024
1 parent eee9609 commit 2ba2d82
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 2ba2d82

Please sign in to comment.