@@ -36,13 +36,12 @@ import type * as OnyxTypes from '@src/types/onyx';
3636
3737type ChatActionableButtonsProps = {
3838 action : OnyxTypes . ReportAction ;
39- report : OnyxEntry < OnyxTypes . Report > ;
40- originalReport : OnyxEntry < OnyxTypes . Report > ;
39+ actionReport : OnyxEntry < OnyxTypes . Report > ;
40+ actionReportID : string | undefined ;
4141 reportID : string | undefined ;
42- originalReportID : string ;
4342} ;
4443
45- function ChatActionableButtons ( { action, report , originalReport , reportID, originalReportID } : ChatActionableButtonsProps ) {
44+ function ChatActionableButtons ( { action, actionReport , actionReportID , reportID} : ChatActionableButtonsProps ) {
4645 const styles = useThemeStyles ( ) ;
4746 const personalDetail = useCurrentUserPersonalDetails ( ) ;
4847 const { isRestrictedToPreferredPolicy, preferredPolicyID} = usePreferredPolicy ( ) ;
@@ -72,7 +71,6 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
7271 ] ;
7372 }
7473
75- const reportActionReport = originalReport ?? report ;
7674 if ( isConciergeCategoryOptions ( action ) ) {
7775 const options = getOriginalMessage ( action ) ?. options ;
7876 if ( ! options ) {
@@ -83,7 +81,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
8381 return [ ] ;
8482 }
8583
86- if ( ! reportActionReport ) {
84+ if ( ! actionReport ) {
8785 return [ ] ;
8886 }
8987
@@ -92,7 +90,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
9290 key : `${ action . reportActionID } -conciergeCategoryOptions-${ option } ` ,
9391 onPress : ( ) => {
9492 resolveConciergeCategoryOptions (
95- reportActionReport ,
93+ actionReport ,
9694 reportID ,
9795 action . reportActionID ,
9896 option ,
@@ -114,7 +112,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
114112 return [ ] ;
115113 }
116114
117- if ( ! reportActionReport ) {
115+ if ( ! actionReport ) {
118116 return [ ] ;
119117 }
120118
@@ -123,7 +121,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
123121 key : `${ action . reportActionID } -conciergeDescriptionOptions-${ option } ` ,
124122 onPress : ( ) => {
125123 resolveConciergeDescriptionOptions (
126- reportActionReport ,
124+ actionReport ,
127125 reportID ,
128126 action . reportActionID ,
129127 option ,
@@ -135,7 +133,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
135133 } ) ) ;
136134 }
137135 const messageHtml = getReportActionMessage ( action ) ?. html ;
138- if ( messageHtml && reportActionReport ) {
136+ if ( messageHtml && actionReport ) {
139137 const followups = parseFollowupsFromHtml ( messageHtml ) ;
140138 if ( followups && followups . length > 0 ) {
141139 return followups . map ( ( followup ) => ( {
@@ -144,7 +142,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
144142 key : `${ action . reportActionID } -followup-${ followup . text } ` ,
145143 onPress : ( ) => {
146144 resolveSuggestedFollowup (
147- reportActionReport ,
145+ actionReport ,
148146 reportID ,
149147 action ,
150148 followup ,
@@ -159,9 +157,8 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
159157 }
160158
161159 if ( isActionableTrackExpense ( action ) ) {
162- const reportActionReportID = originalReportID ?? reportID ;
163160 const baseDraftTransactionParams = {
164- reportID : reportActionReportID ,
161+ reportID : actionReportID ,
165162 reportActionID : action . reportActionID ,
166163 introSelected,
167164 draftTransactionIDs,
@@ -199,7 +196,7 @@ function ChatActionableButtons({action, report, originalReport, reportID, origin
199196 text : 'actionableMentionTrackExpense.nothing' ,
200197 key : `${ action . reportActionID } -actionableMentionTrackExpense-nothing` ,
201198 onPress : ( ) => {
202- dismissTrackExpenseActionableWhisper ( reportActionReportID , action ) ;
199+ dismissTrackExpenseActionableWhisper ( actionReportID , action ) ;
203200 } ,
204201 } ) ;
205202 return options ;
0 commit comments