Skip to content

Can't disable royalties when minting #277

@cheesestringer

Description

@cheesestringer

Trying to mint an NFT with a royalty_percentage of 0 blocks the user with an error message of:

image

Checking the tutorial it seems 0 is an allowed value to disable royalties.

An integer from 0 - 10 describing the amount of royalty to be collected by the creator each time the NFT is sold. For example, if a creator mints an NFT with a royalty percentage of 10, the creator will receive 10% of the proceeds of every sale. Royalties are distributed to creators at the end of each month. If an NFT is minted with a royalty percentage of 0, no royalties will be collected.

Due to the royaltyPercentage falsy check in the updateBtnStatus function in useNFTMint.ts this is currently failing:

!error &&
   nftMintValue.royaltyPercentage && // 0 is falsy so fails early
   Number.isInteger(nftMintValue.royaltyPercentage / 1) &&
   nftMintValue.royaltyPercentage >= 0 &&
   nftMintValue.royaltyPercentage <= 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions