From ab559aaecaeac47444842992b625781b53312fdb Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Fri, 27 Sep 2024 09:22:44 +0800 Subject: [PATCH] chore: remove await --- src/hooks/useOAuth2.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/useOAuth2.ts b/src/hooks/useOAuth2.ts index 7898499..1003a0c 100644 --- a/src/hooks/useOAuth2.ts +++ b/src/hooks/useOAuth2.ts @@ -34,8 +34,8 @@ export const useOAuth2 = (OAuth2GrowthBookConfig: OAuth2GBConfig, WSLogoutAndRed const allowedOrigin = getOAuthOrigin(); if (allowedOrigin === event.origin) { if (event.data === 'logout_complete') { - console.warn("logout completed") - await WSLogoutAndRedirect(); + console.warn('logout completed'); + WSLogoutAndRedirect(); } else { console.warn('Unexpected message received: ', event.data); } @@ -50,7 +50,7 @@ export const useOAuth2 = (OAuth2GrowthBookConfig: OAuth2GBConfig, WSLogoutAndRed const OAuth2Logout = useCallback(async () => { if (!isOAuth2Enabled) { - await WSLogoutAndRedirect(); + WSLogoutAndRedirect(); return; } @@ -61,8 +61,8 @@ export const useOAuth2 = (OAuth2GrowthBookConfig: OAuth2GBConfig, WSLogoutAndRed iframe.style.display = 'none'; document.body.appendChild(iframe); - setTimeout(async () => { - await WSLogoutAndRedirect(); + setTimeout(() => { + WSLogoutAndRedirect(); }, 10000); }