diff --git a/src/components/projects/ProjectPledges.jsx b/src/components/projects/ProjectPledges.jsx index 0bcf352..bb88a6f 100644 --- a/src/components/projects/ProjectPledges.jsx +++ b/src/components/projects/ProjectPledges.jsx @@ -169,11 +169,11 @@ const getSendFn = (pledgeType, filteredPledges) => { const getArgs = (pledgeType, filteredPledges) => { if (pledgeTypes[pledgeType] === PLEDGED) { const formattedPledges = filteredPledges.map(pledge => ({ amount: pledge.amount, id: pledge.idPledge })) - const encodedPledges = encodePledges(formattedPledges) - const withdrawArgs = [filteredPledges[0].id, filteredPledges[0].amount] - return filteredPledges.length > 1 ? [encodedPledges] : withdrawArgs + if (filteredPledges.length > 1) return [encodePledges(formattedPledges)] + const withdrawArgs = [formattedPledges[0].id, formattedPledges[0].amount] + return withdrawArgs } - const { idPayment } = filteredPledges[0].authorization.returnValues + const { idPayment } = filteredPledges.filter(p => !!p)[0].authorization.returnValues return [idPayment] } const SubmissionSection = ({ classes, openSnackBar, syncWithRemote, pledges, pledgeType }) => {