Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading