File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/pages/TransactionMerge Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import ROUTES from '@src/ROUTES';
2828import type SCREENS from '@src/SCREENS' ;
2929import type { Transaction } from '@src/types/onyx' ;
3030import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue' ;
31+ import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute' ;
3132
3233type 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 }
You can’t perform that action at this time.
0 commit comments