Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when trying to use Slackin badge and Twitter follow badge on same page #86

Open
paltman opened this issue Aug 12, 2015 · 1 comment

Comments

@paltman
Copy link

paltman commented Aug 12, 2015

I believe the bug is on this line: https://github.com/rauchg/slackin/blob/master/lib/assets/badge.js#L76

Twitter uses the same technique as Slacking to embed a badge, however, they send an object in e.data instead of a string, so while the badges will end up both working on the page you end up with a javascript error in your console because you can't substr and object.

I believe the fix would be to rewrite:

if (wp == e.data.substr(0, wp.length))

as:

if (typeof e.data === "string" && wp === e.data.substr(0, wp.length))

Thoughts?

@riknoll
Copy link

riknoll commented Sep 23, 2015

I'm having the same problem. Are there any plans to issue a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants