Skip to content

Commit

Permalink
fix(main.ts): remove unload listener
Browse files Browse the repository at this point in the history
  • Loading branch information
i7N3 committed Jan 9, 2023
1 parent e412b2c commit a40de32
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ export default class GoogleOAuthProvider {
if (onScriptLoadError) onScriptLoadError();
};
document.body.appendChild(scriptTag);

window.addEventListener('unload', () => {
document.body.removeChild(scriptTag);
});
}

useGoogleLogin(opts: UseGoogleLoginOptions) {
Expand Down Expand Up @@ -137,10 +133,6 @@ export default class GoogleOAuthProvider {
});

window.google?.accounts.id.prompt(promptMomentNotification);

window.addEventListener('unload', () => {
window.google?.accounts.id.cancel();
});
}

useRenderButton(opts: GoogleLoginProps) {
Expand Down Expand Up @@ -201,9 +193,5 @@ export default class GoogleOAuthProvider {
if (useOneTap) {
window.google?.accounts.id.prompt(promptMomentNotification);
}

window.addEventListener('unload', () => {
if (useOneTap) window.google?.accounts.id.cancel();
});
}
}

0 comments on commit a40de32

Please sign in to comment.