Load contribution details from IPFS

This commit is contained in:
2017-06-07 10:35:57 +02:00
parent a918719b8f
commit 1f41dbcae5
2 changed files with 43 additions and 2 deletions
+10 -2
View File
@@ -148,8 +148,16 @@ export default Service.extend({
url : p[6],
ipfsHash : p[7]
});
Ember.Logger.debug('[kredits] proposal', proposal);
resolve(proposal);
if (proposal.get('ipfsHash')) {
proposal.loadContribution(this.get('ipfs')).then(
() => resolve(proposal),
err => reject(err)
);
} else {
Ember.Logger.warn('[kredits] proposal from blockchain is missing IPFS hash', proposal);
resolve(proposal);
}
}).catch(err => reject(err));
});
return promise;