Update according to suggestions
This commit is contained in:
@@ -118,7 +118,7 @@ export default Service.extend({
|
|||||||
getContributorById(id) {
|
getContributorById(id) {
|
||||||
return this.get('contributorsContract')
|
return this.get('contributorsContract')
|
||||||
.then((contract) => contract.getContributorById(id))
|
.then((contract) => contract.getContributorById(id))
|
||||||
.then(this.replaceIpfsHash)
|
.then(this.reassembleIpfsHash)
|
||||||
// Set basic data
|
// Set basic data
|
||||||
.then(({ account: address, balance, ipfsHash, isCore }) => {
|
.then(({ account: address, balance, ipfsHash, isCore }) => {
|
||||||
let isCurrentUser = this.get('currentUserAccounts').includes(address);
|
let isCurrentUser = this.get('currentUserAccounts').includes(address);
|
||||||
@@ -157,9 +157,12 @@ export default Service.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
replaceIpfsHash(data) {
|
reassembleIpfsHash(data) {
|
||||||
let { ipfsHash: digest, hashFunction, hashSize } = data;
|
let { ipfsHash: digest, hashFunction, hashSize } = data;
|
||||||
data.ipfsHash = fromBytes32({ digest, hashFunction, hashSize });
|
data.ipfsHash = fromBytes32({ digest, hashFunction, hashSize });
|
||||||
|
delete data.hashFunction;
|
||||||
|
delete data.hashSize;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user