@@ -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' ;
@@ -198,13 +199,19 @@ function IOURequestStepUpgrade({
198199 }
199200 case CONST . UPGRADE_PATHS . REPORTS :
200201 if ( action === CONST . IOU . ACTION . CREATE && policyID ) {
201- // Coming from "Create report" (no workspace) — create directly with the just-created
202- // workspace. forceReplace removes the upgrade screen from history so back returns to
203- // the originating screen, not the upgrade step.
202+ // "Create report" with no workspace: open the report where the user started.
204203 const { reportID : newReportID } = createReportForCurrentUser ( policyID ) ;
205- Navigation . setNavigationActionToMicrotaskQueue ( ( ) => {
206- Navigation . navigate ( ROUTES . REPORT_WITH_ID . getRoute ( newReportID ) , { forceReplace : true } ) ;
207- } ) ;
204+ if ( isSearchTopmostFullScreenRoute ( ) ) {
205+ // Spend/Search tab: replace the upgrade screen within the RHP (same navigator,
206+ // so forceReplace holds). Back returns to Spend > Reports.
207+ Navigation . setNavigationActionToMicrotaskQueue ( ( ) => {
208+ Navigation . navigate ( ROUTES . SEARCH_MONEY_REQUEST_REPORT . getRoute ( { reportID : newReportID } ) , { forceReplace : true } ) ;
209+ } ) ;
210+ } else {
211+ // Elsewhere (e.g. FAB): dismiss the upgrade RHP first, then open in Inbox,
212+ // so back doesn't return to the upgrade step.
213+ Navigation . dismissModalWithReport ( { reportID : newReportID } ) ;
214+ }
208215 } else {
209216 Navigation . goBack ( ) ;
210217 navigateWithMicrotask ( ROUTES . MONEY_REQUEST_STEP_REPORT . getRoute ( action , CONST . IOU . TYPE . SUBMIT , transactionID , reportID ) ) ;
0 commit comments