@@ -17,34 +17,20 @@ type MovedTransactionActionProps = {
1717 /** The moved transaction action data */
1818 action : ReportAction < typeof CONST . REPORT . ACTIONS . TYPE . MOVED_TRANSACTION > ;
1919
20- /** The element to render when there is no report that the transaction was moved to or from */
21- emptyHTML : React . JSX . Element ;
22-
2320 /** Original report from which the given reportAction is first created */
2421 originalReport : OnyxEntry < Report > ;
2522} ;
2623
27- function MovedTransactionAction ( { action, emptyHTML , originalReport} : MovedTransactionActionProps ) {
24+ function MovedTransactionAction ( { action, originalReport} : MovedTransactionActionProps ) {
2825 const { translate} = useLocalize ( ) ;
2926 const movedTransactionOriginalMessage = getOriginalMessage ( action ) ;
30- const toReportID = movedTransactionOriginalMessage ?. toReportID ;
3127 const fromReportID = movedTransactionOriginalMessage ?. fromReportID ;
3228
33- const [ toReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ toReportID } ` ) ;
3429 const [ fromReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ fromReportID } ` ) ;
3530 const [ conciergeReportID ] = useOnyx ( ONYXKEYS . CONCIERGE_REPORT_ID ) ;
3631 const [ childReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ getNonEmptyStringOnyxID ( action . childReportID ) } ` ) ;
3732
3833 const isPendingDelete = fromReport ?. pendingFields ?. preview === CONST . RED_BRICK_ROAD_PENDING_ACTION . DELETE ;
39- // When the transaction is moved from personal space (unreported), fromReportID will be "0" which doesn't exist in allReports
40- const hasFromReport = fromReportID === CONST . REPORT . UNREPORTED_REPORT_ID ? true : ! ! fromReport ;
41-
42- // When expenses are merged multiple times, the previous fromReportID may reference a deleted report,
43- // making it impossible to retrieve the report name for display
44- // Ref: https://github.com/Expensify/App/issues/70338
45- if ( ! toReport && ! hasFromReport ) {
46- return emptyHTML ;
47- }
4834
4935 const message = getMovedTransactionMessage ( translate , action , conciergeReportID ) ;
5036
0 commit comments