Update kredits service
This commit is contained in:
@@ -31,7 +31,12 @@ export default Ember.Object.extend({
|
||||
* @public
|
||||
*/
|
||||
loadProfile(ipfs) {
|
||||
let promise = new Ember.RSVP.Promise((resolve, reject) => {
|
||||
return new Ember.RSVP.Promise((resolve, reject) => {
|
||||
if (!this.get('profileHash')) {
|
||||
resolve(this);
|
||||
return;
|
||||
}
|
||||
|
||||
ipfs.getFile(this.get('profileHash')).then(content => {
|
||||
let profileJSON = JSON.parse(content);
|
||||
let profile = Ember.Object.create(profileJSON);
|
||||
@@ -58,14 +63,12 @@ export default Ember.Object.extend({
|
||||
}
|
||||
|
||||
Ember.Logger.debug('[contributor] loaded contributor profile', profile);
|
||||
resolve();
|
||||
resolve(this);
|
||||
}).catch((err) => {
|
||||
Ember.Logger.error('[contributor] error trying to load contributor profile', this.get('profileHash'), err);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
|
||||
return promise;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user