Skip to content

Commit b21c05b

Browse files
committed
update code
1 parent 58c152d commit b21c05b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/pages/TransactionMerge/ConfirmationPage.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import ROUTES from '@src/ROUTES';
2828
import type SCREENS from '@src/SCREENS';
2929
import type {Transaction} from '@src/types/onyx';
3030
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
31+
import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute';
3132

3233
type ConfirmationPageProps = PlatformStackScreenProps<MergeTransactionNavigatorParamList, typeof SCREENS.MERGE_TRANSACTION.CONFIRMATION_PAGE>;
3334

@@ -79,7 +80,18 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
7980

8081
// If we're on search, dismiss the modal and stay on search
8182
if (!isOnSearch && reportIDToDismiss && reportID !== targetTransaction.reportID) {
82-
Navigation.dismissModalWithReport({reportID: reportIDToDismiss});
83+
// Navigate to search money report screen if we're on Reports
84+
if (isSearchTopmostFullScreenRoute()) {
85+
// Close the current modal screen
86+
Navigation.dismissModal();
87+
// Ensure the dismiss completes first
88+
Navigation.setNavigationActionToMicrotaskQueue(() => {
89+
// Navigate to the money request report in search results
90+
Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: reportIDToDismiss}));
91+
});
92+
} else {
93+
Navigation.dismissModalWithReport({reportID: reportIDToDismiss});
94+
}
8395
} else {
8496
Navigation.dismissModal();
8597
}

0 commit comments

Comments
 (0)