Skip to content

Commit

Permalink
fix(ClaimTokenModal): check balance with native currency decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Nov 29, 2024
1 parent ab2df3b commit e582f85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rewards/Token/ClaimTokenModal/ClaimTokenModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from "utils/rolePlatformHelpers"
import { formatUnits } from "viem"
import { useAccount } from "wagmi"
import { Chains } from "wagmiConfig/chains"
import { CHAIN_CONFIG, Chains } from "wagmiConfig/chains"
import TokenClaimFeeTable from "../TokenClaimFeeTable"
import { useTokenRewardContext } from "../TokenRewardContext"
import useCollectToken from "../hooks/useCollectToken"
Expand Down Expand Up @@ -102,9 +102,9 @@ const ClaimTokenModal = ({ isOpen, onClose }: Props) => {
)

const formattedFee =
fee.isLoading || token.isLoading || !fee?.amount || !token?.data?.decimals
fee.isLoading || !fee?.amount
? null
: formatUnits(fee.amount, token.data.decimals)
: formatUnits(fee.amount, CHAIN_CONFIG[chain!].nativeCurrency.decimals)

const { isBalanceSufficient } = useIsBalanceSufficient({
address: NULL_ADDRESS,
Expand Down

0 comments on commit e582f85

Please sign in to comment.