@@ -24,6 +24,7 @@ import {createNewReport} from '@libs/actions/Report';
2424import { changeTransactionsReport , setTransactionReport } from '@libs/actions/Transaction' ;
2525import type CreateWorkspaceParams from '@libs/API/parameters/CreateWorkspaceParams' ;
2626import getPlatform from '@libs/getPlatform' ;
27+ import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute' ;
2728import Navigation from '@libs/Navigation/Navigation' ;
2829import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
2930import type { MoneyRequestNavigatorParamList } from '@libs/Navigation/types' ;
@@ -197,13 +198,19 @@ function IOURequestStepUpgrade({
197198 }
198199 case CONST . UPGRADE_PATHS . REPORTS :
199200 if ( action === CONST . IOU . ACTION . CREATE && policyID ) {
200- // Coming from "Create report" (no workspace) — create directly with the just-created
201- // workspace. forceReplace removes the upgrade screen from history so back returns to
202- // the originating screen, not the upgrade step.
201+ // "Create report" with no workspace: open the report where the user started.
203202 const { reportID : newReportID } = createReportForCurrentUser ( policyID ) ;
204- Navigation . setNavigationActionToMicrotaskQueue ( ( ) => {
205- Navigation . navigate ( ROUTES . REPORT_WITH_ID . getRoute ( newReportID ) , { forceReplace : true } ) ;
206- } ) ;
203+ if ( isSearchTopmostFullScreenRoute ( ) ) {
204+ // Spend/Search tab: replace the upgrade screen within the RHP (same navigator,
205+ // so forceReplace holds). Back returns to Spend > Reports.
206+ Navigation . setNavigationActionToMicrotaskQueue ( ( ) => {
207+ Navigation . navigate ( ROUTES . SEARCH_MONEY_REQUEST_REPORT . getRoute ( { reportID : newReportID } ) , { forceReplace : true } ) ;
208+ } ) ;
209+ } else {
210+ // Elsewhere (e.g. FAB): dismiss the upgrade RHP first, then open in Inbox,
211+ // so back doesn't return to the upgrade step.
212+ Navigation . dismissModalWithReport ( { reportID : newReportID } ) ;
213+ }
207214 } else {
208215 Navigation . goBack ( ) ;
209216 navigateWithMicrotask ( ROUTES . MONEY_REQUEST_STEP_REPORT . getRoute ( action , CONST . IOU . TYPE . SUBMIT , transactionID , reportID ) ) ;
0 commit comments