Skip to content

Commit

Permalink
Merge pull request #43303 from software-mansion-labs/exclude-magic-co…
Browse files Browse the repository at this point in the history
…de-from-last-visited-path

[ideal nav] Exclude abracadabra page from saving in the last visited path
  • Loading branch information
AndrewGable committed Jun 12, 2024
2 parents c82dafd + cfdc288 commit 8563b9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Navigation/NavigationRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 8563b9f

Please sign in to comment.