Skip to content

Commit

Permalink
Merge pull request #39896 from tienifr/fix/39831
Browse files Browse the repository at this point in the history
[CP staging] fix Concierge chat flickers non-stop after redirecting from Old Dot

(cherry picked from commit a7b8d77)
  • Loading branch information
mountiny authored and OSBotify committed Apr 9, 2024
1 parent 1ac68c5 commit 73750b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/LogOutPreviousUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ function LogOutPreviousUserPage({session, route, isAccountLoading}: LogOutPrevio
const shortLivedAuthToken = route.params.shortLivedAuthToken ?? '';
SessionActions.signInWithShortLivedAuthToken(email, shortLivedAuthToken);
}
// We only want to run this effect once on mount (when the page first loads after transitioning from OldDot)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialURL]);

useEffect(() => {
const exitTo = route.params.exitTo as Route | null;
const sessionEmail = session?.email;
const transitionURL = NativeModules.HybridAppModule ? `${CONST.DEEPLINK_BASE_URL}${initialURL ?? ''}` : initialURL;
const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionURL ?? undefined, sessionEmail);
// We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
// because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
// which is already called when AuthScreens mounts.
Expand All @@ -75,8 +83,6 @@ function LogOutPreviousUserPage({session, route, isAccountLoading}: LogOutPrevio
Navigation.navigate(exitUrl);
});
}

// We only want to run this effect once on mount (when the page first loads after transitioning from OldDot)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialURL, isAccountLoading]);

Expand Down

0 comments on commit 73750b5

Please sign in to comment.