Skip to content

Commit

Permalink
Merge pull request #46 from thisyahlen-deriv/thisyahlen/remove-await
Browse files Browse the repository at this point in the history
chore: remove await
  • Loading branch information
thisyahlen-deriv authored Sep 27, 2024
2 parents ac9cd93 + ab559aa commit 2f24179
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hooks/useOAuth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -50,7 +50,7 @@ export const useOAuth2 = (OAuth2GrowthBookConfig: OAuth2GBConfig, WSLogoutAndRed

const OAuth2Logout = useCallback(async () => {
if (!isOAuth2Enabled) {
await WSLogoutAndRedirect();
WSLogoutAndRedirect();
return;
}

Expand All @@ -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);
}

Expand Down

0 comments on commit 2f24179

Please sign in to comment.