@@ -36,7 +36,7 @@ import useTheme from '@hooks/useTheme';
3636import useThemeStyles from '@hooks/useThemeStyles' ;
3737
3838import { setMoneyRequestBillable , setMoneyRequestReimbursable } from '@libs/actions/IOU/MoneyRequest' ;
39- import { clearPromotedDraftReportForPreMount , promoteDraftReportForPreMount } from '@libs/actions/Report' ;
39+ import { clearPromotedDraftReportForPreMount , clearPromotedDraftReportPreMountMarker , promoteDraftReportForPreMount } from '@libs/actions/Report' ;
4040import { setTransactionReport } from '@libs/actions/Transaction' ;
4141import { isMobileSafari } from '@libs/Browser' ;
4242import { canUseTouchScreen } from '@libs/DeviceCapabilities' ;
@@ -681,13 +681,21 @@ function IOURequestStepConfirmation({
681681 const promotedReportID = promotedDraftReportIDRef . current ;
682682 // Read the latest submission state at cleanup time because submission can start or finish after this effect runs.
683683 const hasSubmitIntent = ! ! getPendingSubmitFollowUpAction ( ) ;
684+ if ( ! promotedReportID || promotedReportID !== preMountDestinationReportID || Navigation . getIsFullscreenPreInsertedUnderRHP ( ) ) {
685+ return ;
686+ }
687+
688+ promotedDraftReportIDRef . current = undefined ;
689+
684690 // eslint-disable-next-line react-hooks/exhaustive-deps
685- if ( ! promotedReportID || promotedReportID !== preMountDestinationReportID || hasSubmitIntent || formHasBeenSubmitted . current || Navigation . getIsFullscreenPreInsertedUnderRHP ( ) ) {
691+ if ( hasSubmitIntent || formHasBeenSubmitted . current ) {
692+ // Submission owns the REPORT row from here - only drop the now-irrelevant promotion marker so
693+ // startup cleanup does not mistake this now-real report for an interrupted speculative one.
694+ clearPromotedDraftReportPreMountMarker ( promotedReportID ) ;
686695 return ;
687696 }
688697
689698 clearPromotedDraftReportForPreMount ( promotedReportID ) ;
690- promotedDraftReportIDRef . current = undefined ;
691699 } ;
692700 } , [ preMountDestinationReportID , formHasBeenSubmitted ] ) ;
693701
0 commit comments