diff --git a/src/components/Pledges.jsx b/src/components/Pledges.jsx index f4a2890..4a59ced 100644 --- a/src/components/Pledges.jsx +++ b/src/components/Pledges.jsx @@ -122,7 +122,7 @@ function TableRow({ pledge, amtFormatter, tokenLabel, selectedPledges, setSelect {amtFormatter(amount)} {tokenLabel} {toDecimal(id)} {getDateFromTimestamp(creationTime, true)} - + ) } @@ -147,10 +147,13 @@ function Pledges({ match }) { const amtFormatter = getHumanAmountFormatter(goalToken, currencies) const tokenLabel = getTokenLabel(goalToken, currencies) - const allSelected = selectedPledges.length === pledges.length + const filteredPledges = pledges.filter(({ pledgeState }) => pledgeTypes[pledgeState] !== PAID) + const allSelected = selectedPledges.length === filteredPledges.length const selectAll = () => { if (allSelected) return setSelected([]) - setSelected(pledges.map(p => p.id)) + setSelected( + filteredPledges.map(p => p.id) + ) } const withdrawPledges = () => { @@ -173,6 +176,7 @@ function Pledges({ match }) { openSnackBar('success', 'Funding Confirmed') setSubmitted(false) setConfirmed(true) + setSelected([]) }) .catch(e => { openSnackBar('error', 'An error has occured')