diff --git a/src/components/BlockingViews/FullPageNotFoundView.tsx b/src/components/BlockingViews/FullPageNotFoundView.tsx index 8cabf7dce494..5039de3b20b6 100644 --- a/src/components/BlockingViews/FullPageNotFoundView.tsx +++ b/src/components/BlockingViews/FullPageNotFoundView.tsx @@ -7,7 +7,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import variables from '@styles/variables'; import type {TranslationPaths} from '@src/languages/types'; -import ROUTES from '@src/ROUTES'; import BlockingView from './BlockingView'; import ForceFullScreenView from './ForceFullScreenView'; @@ -50,7 +49,7 @@ function FullPageNotFoundView({ titleKey = 'notFound.notHere', subtitleKey = 'notFound.pageNotFound', linkKey = 'notFound.goBackHome', - onBackButtonPress = () => Navigation.goBack(ROUTES.HOME), + onBackButtonPress = () => Navigation.goBack(), shouldShowLink = true, shouldShowBackButton = true, onLinkPress = () => Navigation.dismissModal(), diff --git a/src/components/HeaderWithBackButton/index.tsx b/src/components/HeaderWithBackButton/index.tsx index ece6295fc7f8..97e915d47b22 100755 --- a/src/components/HeaderWithBackButton/index.tsx +++ b/src/components/HeaderWithBackButton/index.tsx @@ -26,7 +26,7 @@ function HeaderWithBackButton({ icon, iconFill, guidesCallTaskID = '', - onBackButtonPress = () => Navigation.goBack(ROUTES.HOME), + onBackButtonPress = () => Navigation.goBack(), onCloseButtonPress = () => Navigation.dismissModal(), onDownloadButtonPress = () => {}, onThreeDotsButtonPress = () => {}, diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index a5b0d6707421..865be3091dc8 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -104,7 +104,7 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money policy={policy} personalDetails={personalDetails} shouldShowBackButton={isSmallScreenWidth} - onBackButtonPress={() => Navigation.goBack(ROUTES.HOME, false, true)} + onBackButtonPress={() => Navigation.goBack(undefined, false, true)} // Shows border if no buttons or next steps are showing below the header shouldShowBorderBottom={!(shouldShowAnyButton && isSmallScreenWidth) && !(shouldShowNextStep && !isSmallScreenWidth)} shouldShowThreeDotsButton diff --git a/src/components/MoneyRequestHeader.tsx b/src/components/MoneyRequestHeader.tsx index 97f967a32d29..21fe4bbab009 100644 --- a/src/components/MoneyRequestHeader.tsx +++ b/src/components/MoneyRequestHeader.tsx @@ -128,7 +128,7 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction, policy={policy} personalDetails={personalDetails} shouldShowBackButton={isSmallScreenWidth} - onBackButtonPress={() => Navigation.goBack(ROUTES.HOME, false, true)} + onBackButtonPress={() => Navigation.goBack(undefined, false, true)} /> {isPending && ( function adaptStateIfNecessary(state: StackState) { const isNarrowLayout = getIsNarrowLayout(); + + // There should always be SETTINGS.ROOT screen in the state to make sure go back works properly if we deeplinkg to a subpage of settings. + if (!isAtLeastOneInState(state, SCREENS.SETTINGS.ROOT)) { + // @ts-expect-error Updating read only property + // noinspection JSConstantReassignment + state.stale = true; // eslint-disable-line + + // This is necessary for ts to narrow type down to PartialState. + if (state.stale === true) { + // Unshift the root screen to fill left pane. + state.routes.unshift({name: SCREENS.SETTINGS.ROOT}); + } + } + // If the screen is wide, there should be at least two screens inside: // - SETINGS.ROOT to cover left pane. // - SETTINGS_CENTRAL_PANE to cover central pane. if (!isNarrowLayout) { - if (!isAtLeastOneInState(state, SCREENS.SETTINGS.ROOT)) { - // @ts-expect-error Updating read only property - // noinspection JSConstantReassignment - state.stale = true; // eslint-disable-line - - // This is necessary for ts to narrow type down to PartialState. - if (state.stale === true) { - // Unshift the root screen to fill left pane. - state.routes.unshift({name: SCREENS.SETTINGS.ROOT}); - } - } if (!isAtLeastOneInState(state, SCREENS.SETTINGS_CENTRAL_PANE)) { // @ts-expect-error Updating read only property // noinspection JSConstantReassignment diff --git a/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts b/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts index 070f83e19e0f..813e0aecbd5c 100644 --- a/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts +++ b/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts @@ -54,7 +54,7 @@ export default function subscribeToReportCommentPushNotifications() { try { // If a chat is visible other than the one we are trying to navigate to, then we need to navigate back if (Navigation.getActiveRoute().slice(1, 2) === ROUTES.REPORT && !Navigation.isActiveRoute(`r/${reportID}`)) { - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); } Log.info('[PushNotification] onSelected() - Navigation is ready. Navigating...', false, {reportID, reportActionID}); diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index a03eccfe477a..d2c650d6f1c0 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -324,7 +324,7 @@ function createWorkspaceWithPolicyDraftAndNavigateToIt(policyOwnerEmail = '', po .then(() => { if (transitionFromOldDot) { // We must call goBack() to remove the /transition route from history - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); } Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID)); }) @@ -390,7 +390,7 @@ function setUpPoliciesAndNavigate(session: OnyxEntry) { Navigation.waitForProtectedRoutes() .then(() => { // We must call goBack() to remove the /transition route from history - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); Navigation.navigate(exitTo); }) .then(endSignOnTransition); @@ -406,7 +406,7 @@ function redirectThirdPartyDesktopSignIn() { if (url.pathname === `/${ROUTES.GOOGLE_SIGN_IN}` || url.pathname === `/${ROUTES.APPLE_SIGN_IN}`) { Navigation.isNavigationReady().then(() => { - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); Navigation.navigate(ROUTES.DESKTOP_SIGN_IN_REDIRECT); }); } diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 2d13624277f0..d31973f6f120 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1820,7 +1820,7 @@ function deleteReport(reportID: string) { */ function navigateToConciergeChatAndDeleteReport(reportID: string) { // Dismiss the current report screen and replace it with Concierge Chat - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); navigateToConciergeChat(); deleteReport(reportID); } @@ -2276,14 +2276,14 @@ function leaveRoom(reportID: string, isWorkspaceMemberLeavingWorkspaceRoom = fal if (lastAccessedReportID) { // We should call Navigation.goBack to pop the current route first before navigating to Concierge. - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID)); } else { const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins([CONST.EMAIL.CONCIERGE]); const chat = ReportUtils.getChatByParticipants(participantAccountIDs); if (chat?.reportID) { // We should call Navigation.goBack to pop the current route first before navigating to Concierge. - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chat.reportID)); } } diff --git a/src/pages/AddPersonalBankAccountPage.tsx b/src/pages/AddPersonalBankAccountPage.tsx index 1876992f9ced..e2d832f672b2 100644 --- a/src/pages/AddPersonalBankAccountPage.tsx +++ b/src/pages/AddPersonalBankAccountPage.tsx @@ -91,7 +91,7 @@ function AddPersonalBankAccountPage({personalBankAccount, plaidData}: AddPersona Navigation.goBack(ROUTES.HOME)} + onExitPlaid={() => Navigation.goBack()} receivedRedirectURI={getPlaidOAuthReceivedRedirectURI()} selectedPlaidAccountID={selectedPlaidAccountId} /> diff --git a/src/pages/ConciergePage.tsx b/src/pages/ConciergePage.tsx index 514dd0921dfc..251728866a54 100644 --- a/src/pages/ConciergePage.tsx +++ b/src/pages/ConciergePage.tsx @@ -8,7 +8,6 @@ import Navigation from '@libs/Navigation/Navigation'; import type {AuthScreensParamList} from '@libs/Navigation/types'; import * as Report from '@userActions/Report'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; import type {Session} from '@src/types/onyx'; @@ -29,7 +28,7 @@ function ConciergePage({session}: ConciergePageProps) { if (session && 'authToken' in session) { // Pop the concierge loading page before opening the concierge report. Navigation.isNavigationReady().then(() => { - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); Report.navigateToConciergeChat(); }); } else { diff --git a/src/pages/EnablePayments/OnfidoStep.js b/src/pages/EnablePayments/OnfidoStep.js index 8b40c88f62fb..d6279020bca9 100644 --- a/src/pages/EnablePayments/OnfidoStep.js +++ b/src/pages/EnablePayments/OnfidoStep.js @@ -10,7 +10,6 @@ import * as BankAccounts from '@userActions/BankAccounts'; import * as Wallet from '@userActions/Wallet'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import OnfidoPrivacy from './OnfidoPrivacy'; import walletOnfidoDataPropTypes from './walletOnfidoDataPropTypes'; @@ -32,7 +31,7 @@ function OnfidoStep({walletOnfidoData}) { const shouldShowOnfido = walletOnfidoData.hasAcceptedPrivacyPolicy && !walletOnfidoData.isLoading && !walletOnfidoData.error && walletOnfidoData.sdkToken; const goBack = useCallback(() => { - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); }, []); const goToPreviousStep = useCallback(() => { diff --git a/src/pages/ShareCodePage.tsx b/src/pages/ShareCodePage.tsx index 9ed8bf3d76a1..1752c8d4a1a3 100644 --- a/src/pages/ShareCodePage.tsx +++ b/src/pages/ShareCodePage.tsx @@ -78,7 +78,7 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP > Navigation.goBack(isReport ? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID) : ROUTES.SETTINGS)} + onBackButtonPress={() => Navigation.goBack(isReport ? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID) : undefined)} shouldShowBackButton={isReport || isSmallScreenWidth} icon={Illustrations.QrCode} /> diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 8a6d7045dc5f..602fef1fca58 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -287,7 +287,7 @@ function ReportScreen({ }, [shouldHideReport, report]); const goBack = useCallback(() => { - Navigation.goBack(ROUTES.HOME, false, true); + Navigation.goBack(undefined, false, true); }, []); let headerView = ( @@ -423,7 +423,7 @@ function ReportScreen({ Navigation.dismissModal(); if (Navigation.getTopmostReportId() === prevOnyxReportID) { Navigation.setShouldPopAllStateOnUP(); - Navigation.goBack(ROUTES.HOME, false, true); + Navigation.goBack(undefined, false, true); } if (prevReport.parentReportID) { // Prevent navigation to the Money Request Report if it is pending deletion. diff --git a/src/pages/iou/IOUCurrencySelection.js b/src/pages/iou/IOUCurrencySelection.js index 24833fc96fdc..2a48897bfc85 100644 --- a/src/pages/iou/IOUCurrencySelection.js +++ b/src/pages/iou/IOUCurrencySelection.js @@ -105,7 +105,7 @@ function IOUCurrencySelection(props) { // Navigating to "backTo" will result in forward navigation instead, causing disruption to the currency selection. // To prevent any negative experience, we have made the decision to simply close the currency selection page. if (_.isEmpty(backTo) || props.navigation.getState().routes.length === 1) { - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); } else { Navigation.navigate(`${props.route.params.backTo}?currency=${option.currencyCode}`); } diff --git a/src/pages/iou/request/step/IOURequestStepAmount.js b/src/pages/iou/request/step/IOURequestStepAmount.js index f91e7cea533b..19b558ef587e 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.js +++ b/src/pages/iou/request/step/IOURequestStepAmount.js @@ -105,7 +105,7 @@ function IOURequestStepAmount({ }, []); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; const navigateToCurrencySelectionPage = () => { diff --git a/src/pages/iou/request/step/IOURequestStepCategory.js b/src/pages/iou/request/step/IOURequestStepCategory.js index 2218262e1877..30f0b9c7a338 100644 --- a/src/pages/iou/request/step/IOURequestStepCategory.js +++ b/src/pages/iou/request/step/IOURequestStepCategory.js @@ -8,7 +8,6 @@ import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; import reportPropTypes from '@pages/reportPropTypes'; import * as IOU from '@userActions/IOU'; -import ROUTES from '@src/ROUTES'; import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; import StepScreenWrapper from './StepScreenWrapper'; import withFullTransactionOrNotFound from './withFullTransactionOrNotFound'; @@ -42,7 +41,7 @@ function IOURequestStepCategory({ const {translate} = useLocalize(); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepCurrency.js b/src/pages/iou/request/step/IOURequestStepCurrency.js index 06af0ecf3ca4..42e059d7d276 100644 --- a/src/pages/iou/request/step/IOURequestStepCurrency.js +++ b/src/pages/iou/request/step/IOURequestStepCurrency.js @@ -69,7 +69,7 @@ function IOURequestStepCurrency({ Navigation.goBack(routeToAmountPageWithConfirmationAsBackTo); return; } - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepDate.js b/src/pages/iou/request/step/IOURequestStepDate.js index 84a67c30a4d4..5677ef46fcfa 100644 --- a/src/pages/iou/request/step/IOURequestStepDate.js +++ b/src/pages/iou/request/step/IOURequestStepDate.js @@ -11,7 +11,6 @@ import Navigation from '@libs/Navigation/Navigation'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; import StepScreenWrapper from './StepScreenWrapper'; import withFullTransactionOrNotFound from './withFullTransactionOrNotFound'; @@ -40,7 +39,7 @@ function IOURequestStepDate({ const {translate} = useLocalize(); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepDescription.js b/src/pages/iou/request/step/IOURequestStepDescription.js index 25477170f505..d8cfc03c4cfb 100644 --- a/src/pages/iou/request/step/IOURequestStepDescription.js +++ b/src/pages/iou/request/step/IOURequestStepDescription.js @@ -17,7 +17,6 @@ import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; import StepScreenWrapper from './StepScreenWrapper'; import withFullTransactionOrNotFound from './withFullTransactionOrNotFound'; @@ -72,7 +71,7 @@ function IOURequestStepDescription({ ); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepDistance.js b/src/pages/iou/request/step/IOURequestStepDistance.js index 0c95ab1639c9..7ea7854e5a5f 100644 --- a/src/pages/iou/request/step/IOURequestStepDistance.js +++ b/src/pages/iou/request/step/IOURequestStepDistance.js @@ -95,7 +95,7 @@ function IOURequestStepDistance({ }, [numberOfPreviousWaypoints, numberOfWaypoints]); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepMerchant.js b/src/pages/iou/request/step/IOURequestStepMerchant.js index 091e7d8023c3..ddef8251c793 100644 --- a/src/pages/iou/request/step/IOURequestStepMerchant.js +++ b/src/pages/iou/request/step/IOURequestStepMerchant.js @@ -13,7 +13,6 @@ import Navigation from '@libs/Navigation/Navigation'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; import StepScreenWrapper from './StepScreenWrapper'; import withFullTransactionOrNotFound from './withFullTransactionOrNotFound'; @@ -46,7 +45,7 @@ function IOURequestStepMerchant({ const isMerchantRequired = _.some(participants, (participant) => Boolean(participant.isPolicyExpenseChat)); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.js b/src/pages/iou/request/step/IOURequestStepScan/index.js index 7c6efca4a32f..7da97c34cc2b 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.js +++ b/src/pages/iou/request/step/IOURequestStepScan/index.js @@ -112,7 +112,7 @@ function IOURequestStepScan({ } const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; const navigateToConfirmationStep = useCallback(() => { diff --git a/src/pages/iou/request/step/IOURequestStepTag.js b/src/pages/iou/request/step/IOURequestStepTag.js index a05a14cb4403..47ee8c05ad45 100644 --- a/src/pages/iou/request/step/IOURequestStepTag.js +++ b/src/pages/iou/request/step/IOURequestStepTag.js @@ -14,7 +14,6 @@ import reportPropTypes from '@pages/reportPropTypes'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; import StepScreenWrapper from './StepScreenWrapper'; import withFullTransactionOrNotFound from './withFullTransactionOrNotFound'; @@ -59,7 +58,7 @@ function IOURequestStepTag({ const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT; const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; /** diff --git a/src/pages/iou/request/step/IOURequestStepTaxAmountPage.js b/src/pages/iou/request/step/IOURequestStepTaxAmountPage.js index d1352f5b1f5d..02b0c3c38dd5 100644 --- a/src/pages/iou/request/step/IOURequestStepTaxAmountPage.js +++ b/src/pages/iou/request/step/IOURequestStepTaxAmountPage.js @@ -99,7 +99,7 @@ function IOURequestStepTaxAmountPage({ ); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; const navigateToCurrencySelectionPage = () => { diff --git a/src/pages/iou/request/step/IOURequestStepTaxRatePage.js b/src/pages/iou/request/step/IOURequestStepTaxRatePage.js index cf91ac1e1812..edcc8c8fa592 100644 --- a/src/pages/iou/request/step/IOURequestStepTaxRatePage.js +++ b/src/pages/iou/request/step/IOURequestStepTaxRatePage.js @@ -14,7 +14,6 @@ import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import * as IOU from '@userActions/IOU'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; import withFullTransactionOrNotFound from './withFullTransactionOrNotFound'; import withWritableReportOrNotFound from './withWritableReportOrNotFound'; @@ -51,7 +50,7 @@ function IOURequestStepTaxRatePage({ const {translate} = useLocalize(); const navigateBack = () => { - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; const defaultTaxKey = policyTaxRates.defaultExternalID; @@ -64,7 +63,7 @@ function IOURequestStepTaxRatePage({ IOU.setMoneyRequestTaxRate(transaction.transactionID, taxes); IOU.setMoneyRequestTaxAmount(transaction.transactionID, amountInSmallestCurrencyUnits); - Navigation.goBack(backTo || ROUTES.HOME); + Navigation.goBack(backTo); }; return ( diff --git a/src/pages/settings/Profile/CustomStatus/StatusPage.js b/src/pages/settings/Profile/CustomStatus/StatusPage.js index f519e0399a26..f6c5f5543fa0 100644 --- a/src/pages/settings/Profile/CustomStatus/StatusPage.js +++ b/src/pages/settings/Profile/CustomStatus/StatusPage.js @@ -70,7 +70,7 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) { return DateUtils.isTimeAtLeastOneMinuteInFuture({dateTimeString: clearAfterTime}); }, [draftClearAfter, currentUserClearAfter]); - const navigateBackToPreviousScreen = useCallback(() => Navigation.goBack('', false, true), []); + const navigateBackToPreviousScreen = useCallback(() => Navigation.goBack(), []); const updateStatus = useCallback( ({emojiCode, statusText}) => { const clearAfterTime = draftClearAfter || currentUserClearAfter || CONST.CUSTOM_STATUS_TYPES.NEVER; diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 966fef449da4..b5e77ab438f5 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -164,7 +164,7 @@ function ProfilePage(props) { > Navigation.goBack(ROUTES.SETTINGS)} + onBackButtonPress={() => Navigation.goBack()} shouldShowBackButton={props.isSmallScreenWidth} icon={Illustrations.Profile} /> diff --git a/src/pages/settings/Security/SecuritySettingsPage.tsx b/src/pages/settings/Security/SecuritySettingsPage.tsx index b6881a9b3683..5bac2a23eb8d 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.tsx +++ b/src/pages/settings/Security/SecuritySettingsPage.tsx @@ -49,7 +49,7 @@ function SecuritySettingsPage() { return ( Navigation.goBack(ROUTES.SETTINGS)} + onBackButtonPress={() => Navigation.goBack()} shouldShowBackButton={isSmallScreenWidth} illustration={LottieAnimations.Safe} backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.SECURITY].backgroundColor} diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 417d5b890dea..1ba414ef7ebd 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -340,7 +340,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod > Navigation.goBack(ROUTES.SETTINGS)} + onBackButtonPress={() => Navigation.goBack()} icon={Illustrations.MoneyIntoWallet} shouldShowBackButton={isSmallScreenWidth} /> diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index 00bdce30891a..bd5de51e0503 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -103,7 +103,7 @@ function WorkspaceInviteMessagePage(props) { Policy.setWorkspaceInviteMembersDraft(props.route.params.policyID, {}); SearchInputManager.searchInput = ''; // Pop the invite message page before navigating to the members page. - Navigation.goBack(ROUTES.HOME); + Navigation.goBack(); Navigation.navigate(ROUTES.WORKSPACE_MEMBERS.getRoute(props.route.params.policyID)); };