From 71d338c8537cc227e76751dd4e79de6fff0cb780 Mon Sep 17 00:00:00 2001 From: Dmitrii Goriunov Date: Sun, 9 Jan 2022 19:01:00 +1300 Subject: [PATCH] Allow whitelistMintSettings to be null (#1458) --- js/packages/candy-machine-ui/src/candy-machine.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/packages/candy-machine-ui/src/candy-machine.ts b/js/packages/candy-machine-ui/src/candy-machine.ts index 074eba92bd9..1eda65ee8f8 100644 --- a/js/packages/candy-machine-ui/src/candy-machine.ts +++ b/js/packages/candy-machine-ui/src/candy-machine.ts @@ -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,