diff --git a/app/services/kredits.js b/app/services/kredits.js index 2f30627..87564f2 100644 --- a/app/services/kredits.js +++ b/app/services/kredits.js @@ -117,7 +117,7 @@ export default Service.extend({ getContributorById(id) { return this.get('contributorsContract') - .then((contract) => contract.contributors(id)) + .then((contract) => contract.getContributorById(id)) // Set basic data .then(({ account: address, @@ -125,8 +125,8 @@ export default Service.extend({ hashSize, isCore, profileHash: digest, + balance }) => { - let isCurrentUser = this.get('currentUserAccounts').includes(address); let profileHash = fromBytes32({ digest, hashFunction, hashSize }); @@ -136,17 +136,9 @@ export default Service.extend({ isCore, isCurrentUser, profileHash, + balance: balance.toNumber() }; }) - // Add the balance - .then((data) => { - return this.get('tokenContract') - .then((contract) => contract.balanceOf(data.address)) - .then((balance) => { - data.balance = balance.toNumber(); - return data; - }); - }) // Fetch IPFS data if available .then(this.loadContributorProfile.bind(this)) .then((attributes) => {