Skip to content

Commit edda9c6

Browse files
authored
Merge pull request Expensify#67057 from ryntgh/issue-64318
Fix: User is navigated to the other report the expense was moved to
2 parents 616b3e2 + 13158cf commit edda9c6

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/components/MoneyReportHeader.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,11 @@ function MoneyReportHeader({
926926
const isMobileSelectionModeEnabled = useMobileSelectionMode();
927927

928928
if (isMobileSelectionModeEnabled) {
929+
// If mobile selection mode is enabled but only one or no transactions remain, turn it off
930+
if (transactions.length <= 1) {
931+
turnOffMobileSelectionMode();
932+
}
933+
929934
return (
930935
<HeaderWithBackButton
931936
title={translate('common.selectMultiple')}

src/pages/iou/request/step/IOURequestEditReport.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function IOURequestEditReport({route}: IOURequestEditReportProps) {
3232

3333
changeTransactionsReport(selectedTransactionIDs, item.value);
3434
clearSelectedTransactions(true);
35-
Navigation.dismissModalWithReport({reportID: item.value});
35+
Navigation.dismissModal();
3636
};
3737

3838
return (

src/pages/iou/request/step/IOURequestStepReport.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) {
3131
const isFromGlobalCreate = !!transaction?.isFromGlobalCreate;
3232
const reportOrDraftReport = getReportOrDraftReport(reportIDFromRoute);
3333

34-
const handleGoBackWithReportID = (id: string) => {
34+
const handleGoBack = () => {
3535
if (isEditing) {
36-
Navigation.dismissModalWithReport({reportID: id});
36+
Navigation.dismissModal();
3737
} else {
3838
Navigation.goBack(backTo);
3939
}
@@ -88,7 +88,7 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) {
8888
changeTransactionsReport([transaction.transactionID], item.value);
8989
}
9090

91-
handleGoBackWithReportID(item.value);
91+
handleGoBack();
9292
};
9393

9494
const selectReport = (item: TransactionGroupListItem) => {
@@ -100,7 +100,7 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) {
100100

101101
// Early return for same report selection
102102
if (isSameReport) {
103-
handleGoBackWithReportID(item.value);
103+
handleGoBack();
104104
return;
105105
}
106106

0 commit comments

Comments
 (0)