From 942bea66dee0e95c7c3e85c2dab60fb1af44f883 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 30 Nov 2024 16:21:21 +0800 Subject: [PATCH 1/2] fix no open in desktop alert shows when exitTo is empty --- src/libs/actions/App.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index f1f46aee0a93e..61ce04655ae5a 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -418,6 +418,7 @@ function savePolicyDraftByNewWorkspace(policyID?: string, policyName?: string, p function setUpPoliciesAndNavigate(session: OnyxEntry) { const currentUrl = getCurrentUrl(); if (!session || !currentUrl?.includes('exitTo')) { + endSignOnTransition(); return; } @@ -445,6 +446,8 @@ function setUpPoliciesAndNavigate(session: OnyxEntry) { Navigation.navigate(exitTo); }) .then(endSignOnTransition); + } else { + endSignOnTransition(); } } From a378f4fc95fb3e7de9a878b138843cbbc32edca1 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 30 Nov 2024 16:21:35 +0800 Subject: [PATCH 2/2] fix transition page isn't closed when exitTo is empty --- src/pages/LogOutPreviousUserPage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/LogOutPreviousUserPage.tsx b/src/pages/LogOutPreviousUserPage.tsx index f37759eeaa88d..3f286a230c440 100644 --- a/src/pages/LogOutPreviousUserPage.tsx +++ b/src/pages/LogOutPreviousUserPage.tsx @@ -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) { 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