Skip to content

Commit

Permalink
fix embed for erc1155 maxAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Sep 29, 2022
1 parent 2ddbd8c commit 472dbb8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/shared/claim-button-erc1155.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,9 @@ export const ERC1155ClaimButton: React.FC<ClaimButtoProps> = ({
}
}

const maxAvailable = BigNumber.from(totalAvailableSupply).sub(
claimedSupply.data || 0,
);

let max;
if (maxAvailable.lt(bnMaxClaimable)) {
max = maxAvailable;
if (totalAvailableSupply.lt(bnMaxClaimable)) {
max = totalAvailableSupply;
} else {
max = bnMaxClaimable;
}
Expand All @@ -155,9 +151,9 @@ export const ERC1155ClaimButton: React.FC<ClaimButtoProps> = ({
activeClaimCondition.data?.quantityLimitPerTransaction,
activeClaimCondition.data?.snapshot,
address,
claimedSupply.data,
totalAvailableSupply,
]);

const isSoldOut = useMemo(() => {
try {
return (
Expand Down

0 comments on commit 472dbb8

Please sign in to comment.