Skip to content

Commit

Permalink
feat: add default goBack to latest merge
Browse files Browse the repository at this point in the history
Signed-off-by: Prince Mendiratta <[email protected]>
  • Loading branch information
Prince-Mendiratta committed Sep 19, 2023
1 parent 2a3a449 commit d785775
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/DistanceRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken,
useEffect(updateGradientVisibility, [scrollContainerHeight, scrollContentHeight]);

const navigateBack = () => {
Navigation.goBack(isEditing ? ROUTES.getMoneyRequestConfirmationRoute(iouType, reportID) : null);
Navigation.goBack(isEditing ? ROUTES.getMoneyRequestConfirmationRoute(iouType, reportID) : ROUTES.HOME);
};

const navigateToNextPage = () => {
Expand Down
5 changes: 2 additions & 3 deletions src/pages/PrivateNotes/PrivateNotesEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import * as Report from '../../libs/actions/Report';
import useLocalize from '../../hooks/useLocalize';
import OfflineWithFeedback from '../../components/OfflineWithFeedback';
import focusAndUpdateMultilineInputRange from '../../libs/focusAndUpdateMultilineInputRange';
import ROUTES from '../../ROUTES';

const propTypes = {
/** All of the personal details for everyone */
Expand Down Expand Up @@ -72,7 +73,7 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {
Keyboard.dismiss();

// Take user back to the PrivateNotesView page
Navigation.goBack();
Navigation.goBack(ROUTES.HOME);
};

return (
Expand All @@ -83,14 +84,12 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {
<FullPageNotFoundView
shouldShow={_.isEmpty(report) || _.isEmpty(report.privateNotes) || !_.has(report, ['privateNotes', route.params.accountID, 'note']) || !isCurrentUserNote}
subtitleKey="privateNotes.notesUnavailable"
onBackButtonPress={() => Navigation.goBack()}
>
<HeaderWithBackButton
title={translate('privateNotes.title')}
subtitle="My note"
shouldShowBackButton
onCloseButtonPress={() => Navigation.dismissModal()}
onBackButtonPress={() => Navigation.goBack()}
/>
<View style={[styles.flexGrow1, styles.ph5]}>
<View style={[styles.mb5]}>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/PrivateNotes/PrivateNotesListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,11 @@ function PrivateNotesListPage({report, personalDetailsList, network, session}) {
<ScreenWrapper includeSafeAreaPaddingBottom={false}>
<FullPageNotFoundView
shouldShow={_.isEmpty(report.reportID) || (!report.isLoadingPrivateNotes && network.isOffline && _.isEmpty(lodashGet(report, 'privateNotes', {})))}
onBackButtonPress={() => Navigation.goBack()}
>
<HeaderWithBackButton
title={translate('privateNotes.title')}
shouldShowBackButton
onCloseButtonPress={() => Navigation.dismissModal()}
onBackButtonPress={() => Navigation.goBack()}
/>
{report.isLoadingPrivateNotes && _.isEmpty(lodashGet(report, 'privateNotes', {})) ? (
<FullScreenLoadingIndicator />
Expand Down
2 changes: 0 additions & 2 deletions src/pages/PrivateNotes/PrivateNotesViewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ function PrivateNotesViewPage({route, personalDetailsList, session, report}) {
<FullPageNotFoundView
shouldShow={_.isEmpty(report) || _.isEmpty(report.privateNotes) || !_.has(report, ['privateNotes', route.params.accountID, 'note'])}
subtitleKey="privateNotes.notesUnavailable"
onBackButtonPress={() => Navigation.goBack()}
>
<HeaderWithBackButton
title={translate('privateNotes.title')}
subtitle={isCurrentUserNote ? 'My note' : `${lodashGet(personalDetailsList, [route.params.accountID, 'login'], '')} note`}
shouldShowBackButton
onCloseButtonPress={() => Navigation.dismissModal()}
onBackButtonPress={() => Navigation.goBack()}
/>
<ScrollView style={[styles.flexGrow1]}>
<OfflineWithFeedback pendingAction={lodashGet(report, ['privateNotes', route.params.accountID, 'pendingAction'], null)}>
Expand Down

0 comments on commit d785775

Please sign in to comment.