Skip to content

Commit a7b8d77

Browse files
authored
Merge pull request #39896 from tienifr/fix/39831
[CP staging] fix Concierge chat flickers non-stop after redirecting from Old Dot
2 parents bf1f86a + 654f36e commit a7b8d77

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pages/LogOutPreviousUserPage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ function LogOutPreviousUserPage({session, route, isAccountLoading}: LogOutPrevio
6363
const shortLivedAuthToken = route.params.shortLivedAuthToken ?? '';
6464
SessionActions.signInWithShortLivedAuthToken(email, shortLivedAuthToken);
6565
}
66+
// We only want to run this effect once on mount (when the page first loads after transitioning from OldDot)
67+
// eslint-disable-next-line react-hooks/exhaustive-deps
68+
}, [initialURL]);
69+
70+
useEffect(() => {
6671
const exitTo = route.params.exitTo as Route | null;
72+
const sessionEmail = session?.email;
73+
const transitionURL = NativeModules.HybridAppModule ? `${CONST.DEEPLINK_BASE_URL}${initialURL ?? ''}` : initialURL;
74+
const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionURL ?? undefined, sessionEmail);
6775
// We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
6876
// because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
6977
// which is already called when AuthScreens mounts.
@@ -75,8 +83,6 @@ function LogOutPreviousUserPage({session, route, isAccountLoading}: LogOutPrevio
7583
Navigation.navigate(exitUrl);
7684
});
7785
}
78-
79-
// We only want to run this effect once on mount (when the page first loads after transitioning from OldDot)
8086
// eslint-disable-next-line react-hooks/exhaustive-deps
8187
}, [initialURL, isAccountLoading]);
8288

0 commit comments

Comments
 (0)