GoogleWebComponents / google-signin

Google Sign-in web component
https://elements.polymer-project.org/elements/google-signin
Other
279 stars 89 forks source link

Fires google-signed-out event when the element is initialized #139

Closed masonlouchart closed 7 years ago

masonlouchart commented 8 years ago

I use the google-signin twice in my app. On the login page to allow users to connect and in the app header to allow them to log out. When a user just logged in, the second button is displayed (attached to the DOM in fact) and it fires the google-signed-out event.

I did a workaround to fix this quickly on my side but it does not work on Firefox because I have used the event.target and it's not defined on Firefox (the event is a little bit different from Chrome).

Firefox 44.0.2 on OSX EC 10.11.4 (logged in with only one Google account)

EDIT: I found out it simply a weakness at the initialization. When the element is created the signedIn property changes from undefined to false. So, in this case we don't have to send google-signed-out event. I sent a PR for this ! :wink:

atotic commented 8 years ago

I do not have the bandwidth to understand exactly what's going on, but I think this should be looked at.

masonlouchart commented 8 years ago

This article explains the issue I encountered and why I check the oldVal in the proposed pull request.

esd100 commented 7 years ago

yeah, I'm finding this pretty annoying.

esd100 commented 7 years ago

Is this still an issue? Why hasn't anyone fixed this?

masonlouchart commented 7 years ago

I don't know. I have proposed a PR with a workaround...