bengott/meteor-avatar

Meteor 1.1: avatar-hide-initials CSS class is applied instead of avatar-hide-image

Closed this issue · 6 comments

On the Telescope homepage, avatars are getting the avatar-hide-initials class instead of avatar-hide-image.

For some reason they're working fine on post pages though.

See: http://meta.telesc.pe/ vs http://meta.telesc.pe/posts/3hDwb4D9HQntws4ey

Also, it seems like this started happening with the recent 1.1 update.

Alright, I think the issue the same one we saw before.. expired twitter images. If a user changes his/her twitter profile pic, Telescope doesn't update the services.twitter.profile_image_url until the user logs out and logs back in...

I'm not sure if that's it, as the issue is happening specifically for users who didn't log in via Twitter.

Correct - please see my site: http://today.healthcare/ which is the standard Telescope/Meteor code base. I haven't changed a thing.

The twitter accounts display an avatar correctly, but the others don't. It appears random too - 1 in every 30 seems OK :)

Is there maybe something we could do to avoid these issues altogether? Like setting the avatar image as a background image, instead of using the img tag?

Yeah, you're right. After exploring some more, it's not just a twitter thing. I'm seeing the hide-initials class on gravatars that return 404, which shouldn't happen.

I'm gonna try to put some time in this weekend to do a revamp. Things are too fragile as it is.. I also think the package tries to be too smart, which makes the logic much more complicated than it needs to be.

What if you just added onerror="this.style.display='none';" to the img tag?

See: https://github.com/TelescopeJS/Telescope/blob/master/packages/telescope-embedly/lib/client/post_thumbnail.html#L5