-
Notifications
You must be signed in to change notification settings - Fork 64
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
Race condition on google-client-loader #75 #76
base: master
Are you sure you want to change the base?
Conversation
@@ -140,6 +140,9 @@ | |||
ready: function() { | |||
this._loader = document.createElement('google-js-api'); | |||
this.listen(this._loader, 'js-api-load', '_loadClient'); | |||
if (this._loader.libraryLoaded) { | |||
this._loader.fire('js-api-load',{}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space indent. You can also get rid of 2nd arg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take care of this one?
I ran into this problem too, and the PR fixed it. |
Also ran into this issue, would be great to get this merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix also works on the 2.x branch.
@@ -140,6 +140,9 @@ | |||
ready: function() { | |||
this._loader = document.createElement('google-js-api'); | |||
this.listen(this._loader, 'js-api-load', '_loadClient'); | |||
if (this._loader.libraryLoaded) { | |||
this._loader.fire('js-api-load'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the listening for the js-api-load event is not needed if the library is already loaded. This can be replaced by:
if (this._loader.libraryLoaded) {
this._loadClient();
} else {
this.listen(this._loader, 'js-api-load', '_loadClient');
}
No description provided.