Move contributors + proposals to service

With this change we have all the contributors + proposals all the time in one place and can update them via events.
This commit is contained in:
2018-04-15 19:02:57 +02:00
parent fdda30da67
commit 99bbcda709
11 changed files with 36 additions and 78 deletions
+17
View File
@@ -74,6 +74,23 @@ export default Service.extend({
});
},
totalSupply: computed(function() {
return this.get('kredits').Token.functions.totalSupply();
}),
contributors: [],
proposals: [],
loadContributorsAndProposals() {
return RSVP.hash({
contributors: this.getContributors(),
proposals: this.getProposals(),
}).then(({ contributors, proposals }) => {
this.set('contributors', contributors);
this.set('proposals', proposals);
});
},
// TODO: Only assign valid attributes
buildModel(name, attributes) {
debug('[kredits] build', name, attributes);