Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no open in desktop popup #53331

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libs/actions/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ function savePolicyDraftByNewWorkspace(policyID?: string, policyName?: string, p
function setUpPoliciesAndNavigate(session: OnyxEntry<OnyxTypes.Session>) {
const currentUrl = getCurrentUrl();
if (!session || !currentUrl?.includes('exitTo')) {
endSignOnTransition();
return;
}

Expand Down Expand Up @@ -445,6 +446,8 @@ function setUpPoliciesAndNavigate(session: OnyxEntry<OnyxTypes.Session>) {
Navigation.navigate(exitTo);
})
.then(endSignOnTransition);
} else {
endSignOnTransition();
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/pages/LogOutPreviousUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ function LogOutPreviousUserPage({route}: LogOutPreviousUserPageProps) {
// because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
// which is already called when AuthScreens mounts.
// For HybridApp we have separate logic to handle transitions.
if (!NativeModules.HybridAppModule && exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !isAccountLoading && !isLoggingInAsNewUser) {
if (!NativeModules.HybridAppModule && exitTo !== ROUTES.WORKSPACE_NEW && !isAccountLoading && !isLoggingInAsNewUser) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to fix the issue where this page is never popped out from the stack when exitTo is empty, showing infinite loading.

Navigation.isNavigationReady().then(() => {
// remove this screen and navigate to exit route
Navigation.goBack();
Navigation.navigate(exitTo);
if (exitTo) {
Navigation.navigate(exitTo);
}
});
}
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
Expand Down
Loading