@@ -297,21 +297,26 @@ function useParticipantSubmission({
297297
298298 const newReportID = selectedReportID . current ;
299299 const currentSelfDMReportID = dataRef . current . selfDMReportID ;
300- const shouldUpdateTransactionReportID = effectiveParticipants ?. at ( 0 ) ?. reportID !== newReportID ;
301300 const transactionReportID = newReportID === currentSelfDMReportID ? CONST . REPORT . UNREPORTED_REPORT_ID : newReportID ;
302301 const firstParticipant = effectiveParticipants ?. at ( 0 ) ;
302+
303303 for ( const transaction of drafts ) {
304+ // Check if the transaction's current reportID differs from what it should be
305+ const shouldUpdateTransactionReportID = transaction ?. reportID !== transactionReportID ;
306+
304307 const tag = isMovingTransactionFromTrackExpense && transaction ?. tag ? transaction ?. tag : '' ;
305308 setMoneyRequestTag ( transaction . transactionID , tag ) ;
306309 const policy = isPolicyExpenseChat && firstParticipant ?. policyID ? policies ?. [ `${ ONYXKEYS . COLLECTION . POLICY } ${ firstParticipant . policyID } ` ] : undefined ;
307310 const policyDistance = Object . values ( policy ?. customUnits ?? { } ) . find ( ( customUnit ) => customUnit . name === CONST . CUSTOM_UNITS . NAME_DISTANCE ) ;
308311 const defaultCategory = isDistanceRequest ( transaction ) && policyDistance ?. defaultCategory ? policyDistance ?. defaultCategory : '' ;
309312 const category = isMovingTransactionFromTrackExpense ? ( transaction ?. category ?? '' ) : defaultCategory ;
310313 setMoneyRequestCategory ( transaction . transactionID , category , isMovingTransactionFromTrackExpense ? movingPolicy : undefined , isMovingTransactionFromTrackExpense ) ;
314+
311315 if ( shouldUpdateTransactionReportID ) {
312316 setTransactionReport ( transaction . transactionID , { reportID : transactionReportID } , true ) ;
313317 }
314318 }
319+
315320 if ( ( isCategorizing || isShareAction ) && numberOfParticipants . current === 0 ) {
316321 const email = userDetails . email ?? '' ;
317322 const lastWorkspaceNumber = lastWorkspaceNumberSelector ( policies , email ) ;
0 commit comments