only show pledges that can be pledged

This commit is contained in:
Barry Gitarts 2019-03-22 17:54:56 -04:00 committed by Barry G
parent fd78b641b3
commit 165bbe9d50
2 changed files with 5 additions and 2 deletions

View File

@ -61,7 +61,7 @@ export const updateStalePledges = async () => {
const { amount, nDelegates, pledgeState, blockNumber } = updated
p.amount = amount
p.nDelegates = Number(nDelegates)
p.pledgeState = pledgeState
p.pledgeState = Number(pledgeState)
p.blockNumber = blockNumber
})
})

View File

@ -97,7 +97,10 @@ const SubmissionSection = ({ classes, profiles, delegatePledges, projectId }) =>
setStatus,
status
}) => {
const filteredPledges = values.delegateProfile ? delegatePledges.filter(d => d.profile.id == values.delegateProfile.id && d.pledgeData.amount != '0') : null
const filteredPledges = values.delegateProfile ? delegatePledges.filter(
d => d.profile.id == values.delegateProfile.id && d.pledgeData.amount != '0' && d.pledgeData.pledgeState == 0 && d.pledgeData.intendedProject == 0
) : null
console.log({filteredPledges})
return (
<form onSubmit={handleSubmit} className={classes.submissionRoot}>
<TextField