Skip to content

Commit

Permalink
fix error on fetching token fee ton
Browse files Browse the repository at this point in the history
  • Loading branch information
perfogic committed Aug 5, 2024
1 parent 3d80c3d commit 0f58f37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion components/page/bridge/hooks/useGetFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ const useGetFee = ({ token }: { token: TokenType }) => {
}
}
} catch (error) {
console.log("error", error);
if (
error.message
.toString()
.includes("type: tonbridge_bridge::state::Ratio; key:")
) {
setTokenFee(0);
} else {
console.log(error);
}
}
})();
}, [token, oraiAddress]);
Expand Down
2 changes: 1 addition & 1 deletion helper/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const formatDisplayNumber = (
num: number,
decimal: number = CW20_DECIMALS
) => {
if (num <= 0.001) {
if (num <= 0.001 && num !== 0) {
return "~0.001";
}

Expand Down

0 comments on commit 0f58f37

Please sign in to comment.