johno / ember-cli-gravatar

An Ember component for gravatar image tags
MIT License
45 stars 24 forks source link

Console blows up with errors when hovering over a gravatar #51

Closed jimmay5469 closed 7 years ago

jimmay5469 commented 7 years ago

When I hover my mouse over a gravatar and move it around it causes console errors to repeatedly get thrown. screen shot 2016-12-07 at 3 28 04 pm

Debugging into this exception I see the following: screen shot 2016-12-07 at 3 26 56 pm

As you can see here the has function has been overwritten with the value true. I believe it is getting overwritten in the has-gravatar component https://github.com/johnotander/ember-cli-gravatar/blob/605f5d61298882a513911dc01a85d925d4acdb89/addon/components/has-gravatar.js#L21.

I plan to rename the has property to something different and see if it fixes the issue I'm seeing, but I haven't completely ruled out the possibility that it's not some other addon or something, just seems to all make sense that it would be what I'm describing here.

I will keep you updated, just wanted to raise awareness and also get a reading of if it is important that the property be named has and not hasGravatar or something else. Maybe @AO16 has some insight to that?

Thanks!

andyo729 commented 7 years ago

@jimmay5469 Yea, I think you are on the right track. If you change it from has to hasGravatar I think that should do the trick.

jimmay5469 commented 7 years ago

Ok, I just cloned, npm linked, and commented the referenced line and the has: false definition and am no longer getting the console errors. So the problem is indeed with this addon.

I will try to see if I can rename the property internally but continue yielding it as has so that it doesn't break the current API.

jimmay5469 commented 7 years ago

Alright, looks like this fixed it and I was able to keep the existing has yield in order to keep the same API. See the #52 PR.