Skip to content

Commit

Permalink
Allow whitelistMintSettings to be null (#1458)
Browse files Browse the repository at this point in the history
  • Loading branch information
goriunov authored Jan 9, 2022
1 parent 43ab97a commit 71d338c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/packages/candy-machine-ui/src/candy-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ export const getCandyMachineState = async (
const itemsAvailable = state.data.itemsAvailable.toNumber();
const itemsRedeemed = state.itemsRedeemed.toNumber();
const itemsRemaining = itemsAvailable - itemsRedeemed;
const presale = state.data.whitelistMintSettings.presale &&
(!state.data.goLiveDate || state.data.goLiveDate.toNumber() > new Date().getTime() / 1000);

const presale =
state.data.whitelistMintSettings &&
state.data.whitelistMintSettings.presale &&
(!state.data.goLiveDate ||
state.data.goLiveDate.toNumber() > new Date().getTime() / 1000);

return {
id: candyMachineId,
Expand Down

2 comments on commit 71d338c

@vercel
Copy link

@vercel vercel bot commented on 71d338c Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

candy-machine-ui – ./js/packages/candy-machine-ui

candy-machine-ui-git-master-metaplex.vercel.app
candy-machine-ui.vercel.app
candy-machine-ui-metaplex.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 71d338c Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

metaplex-web – ./js

metaplex-web-metaplex.vercel.app
metaplex.vercel.app
metaplex-web-git-master-metaplex.vercel.app

Please sign in to comment.