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

Race condition on google-client-loader #75 #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

softkot
Copy link

@softkot softkot commented Jul 30, 2016

No description provided.

@@ -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',{});
Copy link
Contributor

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

Copy link
Contributor

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?

@joryphillips
Copy link

I ran into this problem too, and the PR fixed it.

@ssalbdivad
Copy link

Also ran into this issue, would be great to get this merged!

Copy link

@peterfortuin peterfortuin left a 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');

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');
}

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

Successfully merging this pull request may close these issues.

6 participants