Skip to content

Commit

Permalink
filter out old rounds for available matches since payout does not exi…
Browse files Browse the repository at this point in the history
…st (#10213)

* filter out old rounds for available matches since payout does not exist

* updated matching payout conditional

Co-authored-by: Tim Schultz <[email protected]>
  • Loading branch information
Tim Schultz and Tim Schultz authored Mar 1, 2022
1 parent 84ff1a5 commit 5c5df5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/assets/v2/js/grants/matching_funds.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Vue.mixin({
JSON.parse(document.contxt.match_payouts_abi),
contractAddress
);
// After payouts are claimed, this will return 0 which updates value of claim_tx
const amount = await payout_contract.methods.payouts(recipientAddress).call();

if (amount == 0) {
Expand Down Expand Up @@ -255,7 +256,9 @@ Vue.mixin({
return grant.clr_matches.length && grant.clr_matches.filter(a => a.claim_tx).length;
},
canClaimMatch(grant) {
return grant.clr_matches.length && grant.clr_matches.filter(a => !a.claim_tx).length;
return grant.clr_matches.length && grant.clr_matches.filter(
a => a.claim_tx === null &&
a.grant_payout).length;
},
filterMatchingPayout(matches) {
return matches.filter(match => match.grant_payout);
Expand Down

0 comments on commit 5c5df5a

Please sign in to comment.