@@ -137,20 +137,24 @@ function ReportActionsView({
137137
138138 // Get a sorted array of reportActions for both the current report and the transaction thread report associated with this report (if there is one)
139139 // so that we display transaction-level and report-level report actions in order in the one-transaction view
140- const combinedReportActions = useMemo ( ( ) => {
140+ const [ combinedReportActions , parentReportActionForTransactionThread ] = useMemo ( ( ) => {
141141 if ( isEmptyObject ( transactionThreadReportActions ) ) {
142- return allReportActions ;
142+ return [ allReportActions , null ] ;
143143 }
144144
145145 // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions`
146146 const filteredTransactionThreadReportActions = transactionThreadReportActions ?. filter ( ( action ) => action . actionName !== CONST . REPORT . ACTIONS . TYPE . CREATED ) ;
147+ const moneyRequestAction = allReportActions . find ( ( action ) => {
148+ const actionType = ( action as OnyxTypes . OriginalMessageIOU ) . originalMessage ?. type ?? '' ;
149+ return actionType === CONST . IOU . REPORT_ACTION_TYPE . CREATE || actionType === CONST . IOU . REPORT_ACTION_TYPE . TRACK || ! ReportActionsUtils . isSentMoneyReportAction ( action ) ;
150+ } ) ;
147151
148152 // Filter out the money request actions because we don't want to show any preview actions for one-transaction reports
149153 const filteredReportActions = [ ...allReportActions , ...filteredTransactionThreadReportActions ] . filter ( ( action ) => {
150154 const actionType = ( action as OnyxTypes . OriginalMessageIOU ) . originalMessage ?. type ?? '' ;
151155 return actionType !== CONST . IOU . REPORT_ACTION_TYPE . CREATE && actionType !== CONST . IOU . REPORT_ACTION_TYPE . TRACK && ! ReportActionsUtils . isSentMoneyReportAction ( action ) ;
152156 } ) ;
153- return ReportActionsUtils . getSortedReportActions ( filteredReportActions , true ) ;
157+ return [ ReportActionsUtils . getSortedReportActions ( filteredReportActions , true ) , moneyRequestAction ?? null ] ;
154158 } , [ allReportActions , transactionThreadReportActions ] ) ;
155159
156160 const indexOfLinkedAction = useMemo ( ( ) => {
@@ -517,6 +521,7 @@ function ReportActionsView({
517521 transactionThreadReport = { transactionThreadReport }
518522 reportActions = { reportActions }
519523 parentReportAction = { parentReportAction }
524+ parentReportActionForTransactionThread = { parentReportActionForTransactionThread }
520525 onLayout = { recordTimeToMeasureItemLayout }
521526 sortedReportActions = { reportActionsToDisplay }
522527 mostRecentIOUReportActionID = { mostRecentIOUReportActionID }
0 commit comments