@@ -17,7 +17,7 @@ import {translateLocal} from '@libs/Localize';
1717import { appendCountryCode , getPhoneNumberWithoutSpecialChars } from '@libs/LoginUtils' ;
1818import { MaxHeap } from '@libs/MaxHeap' ;
1919import { MinHeap } from '@libs/MinHeap' ;
20- import { getForReportAction } from '@libs/ModifiedExpenseMessage' ;
20+ import { getForReportAction , getForReportActionTemp } from '@libs/ModifiedExpenseMessage' ;
2121import Navigation from '@libs/Navigation/Navigation' ;
2222import Parser from '@libs/Parser' ;
2323import Performance from '@libs/Performance' ;
@@ -603,6 +603,8 @@ function getLastMessageTextForReport({
603603 policyForMovingExpensesID,
604604 reportMetadata,
605605 reportAttributesDerived,
606+ policyTags,
607+ currentUserLogin,
606608} : {
607609 translate : LocalizedTranslate ;
608610 report : OnyxEntry < Report > ;
@@ -614,6 +616,8 @@ function getLastMessageTextForReport({
614616 policyForMovingExpensesID ?: string ;
615617 reportMetadata ?: OnyxEntry < ReportMetadata > ;
616618 reportAttributesDerived ?: ReportAttributesDerivedValue [ 'reports' ] ;
619+ policyTags ?: OnyxEntry < PolicyTagLists > ;
620+ currentUserLogin ?: string ;
617621} ) : string {
618622 const reportID = report ?. reportID ;
619623 const lastReportAction = reportID ? lastVisibleReportActions [ reportID ] : undefined ;
@@ -687,13 +691,23 @@ function getLastMessageTextForReport({
687691 } else if ( isReportMessageAttachment ( { text : report ?. lastMessageText ?? '' , html : report ?. lastMessageHtml , type : '' } ) ) {
688692 lastMessageTextFromReport = `[${ translate ( 'common.attachment' ) } ]` ;
689693 } else if ( isModifiedExpenseAction ( lastReportAction ) ) {
690- const properSchemaForModifiedExpenseMessage = getForReportAction ( {
691- reportAction : lastReportAction ,
692- policyID : report ?. policyID ,
693- movedFromReport,
694- movedToReport,
695- policyForMovingExpensesID,
696- } ) ;
694+ const properSchemaForModifiedExpenseMessage = policyTags
695+ ? getForReportActionTemp ( {
696+ translate,
697+ reportAction : lastReportAction ,
698+ policy,
699+ movedFromReport,
700+ movedToReport,
701+ policyTags,
702+ currentUserLogin : currentUserLogin ?? '' ,
703+ } )
704+ : getForReportAction ( {
705+ reportAction : lastReportAction ,
706+ policyID : report ?. policyID ,
707+ movedFromReport,
708+ movedToReport,
709+ policyForMovingExpensesID,
710+ } ) ;
697711 lastMessageTextFromReport = formatReportLastMessageText ( properSchemaForModifiedExpenseMessage , true ) ;
698712 } else if ( isMovedTransactionAction ( lastReportAction ) ) {
699713 lastMessageTextFromReport = Parser . htmlToText ( getMovedTransactionMessage ( translate , lastReportAction ) ) ;
0 commit comments