Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions google-client-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

}
},

detached: function() {
Expand Down