fix: support mints with 0 supply

This commit is contained in:
Sebastian.Bor 2021-08-13 21:40:23 +02:00
parent dfd9f88b20
commit 6dffc77333
2 changed files with 5 additions and 1 deletions

View File

@ -99,6 +99,10 @@ export function GovernanceConfigFormItem({
// If the supply is small and 1% is below the minimum mint amount then coerce to the minimum value
let minTokenStep = Math.max(mintSupply1Percent, minTokenAmount);
if (maxTokenAmount === 0) {
maxTokenAmount = 1;
}
let minTokensToCreateProposal = minTokenStep;
if (!governanceConfig) {

View File

@ -114,7 +114,7 @@ export function getBigNumberAmount(amount: BN | number) {
// Formats percentage value showing it in human readable form
export function formatPercentage(percentage: number) {
if (percentage === 0) {
if (percentage === 0 || percentage === Infinity) {
return '0%';
}