diff --git a/src/CONST.ts b/src/CONST.ts index d38dad96fc38..1f10aabc6d5c 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -4854,6 +4854,8 @@ const CONST = { TRANSLATION_KEY: 'feedbackSurvey.businessClosing', }, }, + + EXCLUDE_FROM_LAST_VISITED_PATH: [SCREENS.NOT_FOUND, SCREENS.SAML_SIGN_IN, SCREENS.VALIDATE_LOGIN] as string[], } as const; type Country = keyof typeof CONST.ALL_COUNTRIES; diff --git a/src/libs/Navigation/NavigationRoot.tsx b/src/libs/Navigation/NavigationRoot.tsx index e4927c6d5f0d..eaaf5eae12c0 100644 --- a/src/libs/Navigation/NavigationRoot.tsx +++ b/src/libs/Navigation/NavigationRoot.tsx @@ -10,8 +10,8 @@ import {FSPage} from '@libs/Fullstory'; import Log from '@libs/Log'; import {getPathFromURL} from '@libs/Url'; import {updateLastVisitedPath} from '@userActions/App'; +import CONST from '@src/CONST'; import type {Route} from '@src/ROUTES'; -import SCREENS from '@src/SCREENS'; import AppNavigator from './AppNavigator'; import getPolicyIDFromState from './getPolicyIDFromState'; import linkingConfig from './linkingConfig'; @@ -47,7 +47,7 @@ function parseAndLogRoute(state: NavigationState) { const focusedRoute = findFocusedRoute(state); - if (focusedRoute?.name !== SCREENS.NOT_FOUND && focusedRoute?.name !== SCREENS.SAML_SIGN_IN) { + if (focusedRoute && !CONST.EXCLUDE_FROM_LAST_VISITED_PATH.includes(focusedRoute?.name)) { updateLastVisitedPath(currentPath); }