diff --git a/src/Expensify.tsx b/src/Expensify.tsx index 8ec3fa194cf9..ca9dec6d2279 100644 --- a/src/Expensify.tsx +++ b/src/Expensify.tsx @@ -300,7 +300,6 @@ function Expensify({ authenticated={isAuthenticated} lastVisitedPath={lastVisitedPath as Route} initialUrl={initialUrl} - shouldShowRequire2FAModal={shouldShowRequire2FAModal} /> )} diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 071b6d8270d7..77b8467a8c58 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -227,8 +227,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie } if (!initialReportID) { - const initialReport = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, shouldOpenOnAdminRoom(), activeWorkspaceID); - initialReportID = initialReport?.reportID ?? ''; + initialReportID = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, shouldOpenOnAdminRoom(), activeWorkspaceID)?.reportID; } isInitialRender.current = false; diff --git a/src/libs/Navigation/NavigationRoot.tsx b/src/libs/Navigation/NavigationRoot.tsx index 152594ba6b3e..96e3413927a5 100644 --- a/src/libs/Navigation/NavigationRoot.tsx +++ b/src/libs/Navigation/NavigationRoot.tsx @@ -39,9 +39,6 @@ type NavigationRootProps = { /** Fired when react-navigation is ready */ onReady: () => void; - - /** Flag to indicate if the require 2FA modal should be shown to the user */ - shouldShowRequire2FAModal: boolean; }; /** @@ -76,7 +73,7 @@ function parseAndLogRoute(state: NavigationState) { } } -function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady, shouldShowRequire2FAModal}: NavigationRootProps) { +function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady}: NavigationRootProps) { const firstRenderRef = useRef(true); const theme = useTheme(); const {cleanStaleScrollOffsets} = useContext(ScrollOffsetContext); @@ -97,7 +94,7 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady, sh // If the user haven't completed the flow, we want to always redirect them to the onboarding flow. // We also make sure that the user is authenticated. - if (!hasCompletedGuidedSetupFlow && authenticated && !shouldShowRequire2FAModal) { + if (!hasCompletedGuidedSetupFlow && authenticated) { const {adaptedState} = getAdaptedStateFromPath(ROUTES.ONBOARDING_ROOT.route, linkingConfig.config); return adaptedState; }