Merge pull request #117 from 67P/bugfix/vetoed_in_confirmed_list

Remove vetoed contributions from confirmed list
This commit was merged in pull request #117.
This commit is contained in:
2019-05-10 15:54:41 +02:00
committed by GitHub
2 changed files with 9 additions and 6 deletions
+5 -3
View File
@@ -40,9 +40,11 @@ export default Service.extend({
}), }),
contributionsConfirmed: computed('contributions.[]', 'currentBlock', function() { contributionsConfirmed: computed('contributions.[]', 'currentBlock', function() {
return this.contributions.filter(contribution => { return this.contributions
return contribution.confirmedAt <= this.currentBlock; .filterBy('vetoed', false)
}); .filter(contribution => {
return contribution.confirmedAt <= this.currentBlock;
});
}), }),
kreditsByContributor: computed('contributionsUnconfirmed.@each.vetoed', 'contributors', function() { kreditsByContributor: computed('contributionsUnconfirmed.@each.vetoed', 'contributors', function() {
+4 -3
View File
@@ -8,9 +8,10 @@ const data = [
{ id: 3, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 }, { id: 3, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
{ id: 4, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 }, { id: 4, contributorId: 2, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 1500 },
{ id: 5, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000 }, { id: 5, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: false, amount: 5000 },
{ id: 6, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 5000 }, { id: 6, contributorId: 1, confirmedAtBlock: 1000, claimed: false, vetoed: true, amount: 500 },
{ id: 7, contributorId: 1, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 1500 }, { id: 7, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 5000 },
{ id: 8, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: true, amount: 1500 }, { id: 8, contributorId: 1, confirmedAtBlock: 2000, claimed: false, vetoed: false, amount: 1500 },
{ id: 9, contributorId: 3, confirmedAtBlock: 2000, claimed: false, vetoed: true, amount: 1500 },
]; ];
data.forEach(attrs => items.push(Model.create(attrs))); data.forEach(attrs => items.push(Model.create(attrs)));