@@ -11,7 +11,7 @@ import lodashMaxBy from 'lodash/maxBy';
1111import type { OnyxCollection , OnyxEntry , OnyxUpdate } from 'react-native-onyx' ;
1212import Onyx from 'react-native-onyx' ;
1313import type { SvgProps } from 'react-native-svg' ;
14- import type { OriginalMessageChangePolicy , OriginalMessageExportIntegration , OriginalMessageModifiedExpense , OriginalMessageMovedTransaction } from 'src/types/onyx/OriginalMessage' ;
14+ import type { OriginalMessageChangePolicy , OriginalMessageExportIntegration , OriginalMessageModifiedExpense } from 'src/types/onyx/OriginalMessage' ;
1515import type { SetRequired , TupleToUnion , ValueOf } from 'type-fest' ;
1616import { FallbackAvatar , IntacctSquare , NetSuiteSquare , QBDSquare , QBOSquare , XeroSquare } from '@components/Icon/Expensicons' ;
1717import * as defaultGroupAvatars from '@components/Icon/GroupDefaultAvatars' ;
@@ -6085,18 +6085,9 @@ function getDeletedTransactionMessage(action: ReportAction) {
60856085 return message ;
60866086}
60876087
6088- function getReportDetails ( reportID : string ) : { reportName : string ; reportUrl : string } {
6089- const report = allReports ?. [ `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` ] ;
6090- return {
6091- reportName : getReportName ( report ) ?? report ?. reportName ?? '' ,
6092- reportUrl : `${ environmentURL } /r/${ reportID } ` ,
6093- } ;
6094- }
6095-
6096- function getMovedTransactionMessage ( action : ReportAction ) {
6097- const movedTransactionOriginalMessage = getOriginalMessage ( action as ReportAction < typeof CONST . REPORT . ACTIONS . TYPE . MOVED_TRANSACTION > ) ?? { } ;
6098- const { toReportID} = movedTransactionOriginalMessage as OriginalMessageMovedTransaction ;
6099- const { reportName, reportUrl} = getReportDetails ( toReportID ) ;
6088+ function getMovedTransactionMessage ( report : OnyxEntry < Report > ) {
6089+ const reportName = getReportName ( report ) ?? report ?. reportName ?? '' ;
6090+ const reportUrl = `${ environmentURL } /r/${ report ?. reportID } ` ;
61006091 const message = translateLocal ( 'iou.movedTransaction' , {
61016092 reportUrl,
61026093 reportName,
0 commit comments