Skip to content

Commit

Permalink
Social login button remains disabled if Google SDK fails to init (#81152
Browse files Browse the repository at this point in the history
)
  • Loading branch information
p-jackson authored and vykes-mac committed Aug 30, 2023
1 parent 2762b77 commit 2461abe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/components/social-buttons/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GoogleSocialButton extends Component {
}

async loadGoogleIdentityServicesAPI() {
if ( ! window.google?.accounts?.oauth2 ) {
if ( ! window?.google?.accounts?.oauth2 ) {
try {
await loadScript( 'https://accounts.google.com/gsi/client' );
} catch {
Expand All @@ -110,7 +110,7 @@ class GoogleSocialButton extends Component {
}
}

return window.google.accounts.oauth2;
return window?.google?.accounts?.oauth2 ?? null;
}

async handleAuthorizationCode( { auth_code, redirect_uri } ) {
Expand Down

0 comments on commit 2461abe

Please sign in to comment.