FIX: When we don't have an uploaded_avatar_id don't try to show the

avatar. Wait until it's loaded.
This commit is contained in:
Robin Ward 2014-07-24 11:31:08 -04:00
parent 0b368993b7
commit 5aa411b58c

View File

@ -34,7 +34,11 @@ export default Discourse.ObjectController.extend({
var currentUsername = this.get('username'),
wasVisible = this.get('visible');
this.set('avatar', {username: username, uploaded_avatar_id: uploadedAvatarId});
if (uploadedAvatarId) {
this.set('avatar', {username: username, uploaded_avatar_id: uploadedAvatarId});
} else {
this.set('avatar', null);
}
this.setProperties({visible: true, username: username});