handle no pledge info

This commit is contained in:
Barry Gitarts 2019-08-21 16:42:07 -04:00 committed by Barry G
parent b83eb9e7bf
commit 1f35ae88dc

View File

@ -20,7 +20,7 @@ function FundingDetail({ classes, pledgesInfos, goal, goalToken }) {
const { cellText, headerDetails, centerText } = classes
const { prices } = useContext(FundingContext)
const pledgeInfo = pledgesInfos.find(p => p.token.toUpperCase() === goalToken.toUpperCase())
const { lifetimeReceived } = pledgeInfo
const lifetimeReceived = pledgeInfo ? pledgeInfo.lifetimeReceived : '0'
const lifetimeHumanReadible = getAmountFromWei(goalToken, lifetimeReceived)
const fundedPercent = percentToGoal(lifetimeHumanReadible, goal)
const goalAmount = Number(goal).toLocaleString()