Skip to content

Commit

Permalink
fix: fix issue where user is able to attempt to claim nft when they h…
Browse files Browse the repository at this point in the history
…ave no balance (#422)

* fix: fix issue where user is able to attempt to claim nft when they have no balance

* fix: disbale claim btn if user has insufficient strif balance
  • Loading branch information
LordCheta authored Dec 4, 2024
1 parent 02dd51d commit b970ac8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/communities/nft/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ export default function Page() {
}
}

const hasEnoughBalance = stRifBalance > (stRifThreshold ?? 0n)

if (!nftAddress) return null
return (
<MainContainer notProtected>
Expand Down Expand Up @@ -301,7 +303,7 @@ export default function Page() {
variant="primary"
className="my-[16px]"
onClick={handleMinting}
disabled={!tokensAvailable || !address || isClaiming}
disabled={!tokensAvailable || !address || isClaiming || !hasEnoughBalance}
loading={isClaiming}
data-testid="claimButton"
>
Expand Down

0 comments on commit b970ac8

Please sign in to comment.