From b70a7d7a98b9c1af82fbc44fd07186244644c6af Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 5 Feb 2017 12:06:02 +0800 Subject: [PATCH] Remove unnecessary temporary object --- app/services/kredits.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/services/kredits.js b/app/services/kredits.js index c48f222..02ba6de 100644 --- a/app/services/kredits.js +++ b/app/services/kredits.js @@ -60,19 +60,15 @@ export default Ember.Service.extend({ let gatherContributorData = (i) => { let promise = new Ember.RSVP.Promise((resolve, reject) => { - let c = {}; this.getValueFromContract('contributorAddresses', i).then(address => { - c.address = address; this.getValueFromContract('contributors', address).then(person => { - c.person = person; - this.getValueFromContract('balanceOf', c.address).then(balance => { - c.balance = balance; + this.getValueFromContract('balanceOf', address).then(balance => { let contributor = Contributor.create({ - address: c.address, - github_username: c.person[1], - github_uid: c.person[0], - ipfsHash: c.person[3], - kredits: c.balance.toNumber() + address: address, + github_username: person[1], + github_uid: person[0], + ipfsHash: person[3], + kredits: balance.toNumber() }); Ember.Logger.debug('[kredits] contributor', contributor); resolve(contributor);