Move computed collections to kredits service

They should be available from any place with access to the service.
This commit is contained in:
2019-04-27 17:33:25 +01:00
parent 24a3d8beb4
commit afa09f4b8f
2 changed files with 18 additions and 14 deletions
+15 -1
View File
@@ -20,15 +20,29 @@ export default Service.extend({
currentUserAccounts: null, // default to not having an account. this is the wen web3 is loaded.
currentUser: null,
contributors: null,
proposals: null,
contributions: null,
proposals: null,
currentUserIsContributor: notEmpty('currentUser'),
currentUserIsCore: alias('currentUser.isCore'),
hasAccounts: notEmpty('currentUserAccounts'),
accountNeedsUnlock: computed('currentUserAccounts', function() {
return this.currentUserAccounts && isEmpty(this.currentUserAccounts);
}),
contributionsUnconfirmed: computed('contributions.[]', 'currentBlock', function() {
return this.contributions.filter(contribution => {
return contribution.confirmedAt > this.currentBlock;
});
}),
contributionsConfirmed: computed('contributions.[]', 'currentBlock', function() {
return this.contributions.filter(contribution => {
return contribution.confirmedAt <= this.currentBlock;
});
}),
init () {
this._super(...arguments);
this.set('contributors', []);