@@ -162,7 +162,6 @@ import {
162162 getReportActionHtml ,
163163 getReportActionMessage as getReportActionMessageReportUtils ,
164164 getReportActionMessageText ,
165- getReportActions ,
166165 getReportActionText ,
167166 getRetractedMessage ,
168167 getTravelUpdateMessage ,
@@ -8808,43 +8807,25 @@ function isMoneyRequestReportPendingDeletion(reportOrID: OnyxEntry<Report> | str
88088807}
88098808
88108809function navigateToLinkedReportAction ( ancestor : Ancestor , isInNarrowPaneModal : boolean , canUserPerformWrite : boolean | undefined , isOffline : boolean ) {
8811- const parentReport = getReportOrDraftReport ( ancestor . report . parentReportID ) ;
8812- const parentReportAction = getReportAction ( ancestor . report . parentReportID , ancestor . report . parentReportActionID ) ;
8813-
8814- let newAncestor = ancestor ;
8815- // If `parentReport` is an money report with one transaction, navigate directly to `parentReport`,
8816- // preventing redundant navigation when threading back to the parent chat thread
8817- if (
8818- parentReport &&
8819- parentReportAction &&
8820- getOneTransactionThreadReportID ( parentReport , getReportOrDraftReport ( parentReport . chatReportID ) , getReportActions ( parentReport ) , isOffline , undefined , true )
8821- ) {
8822- newAncestor = {
8823- ...ancestor ,
8824- report : parentReport ,
8825- reportAction : parentReportAction ,
8826- } ;
8827- }
8828-
88298810 if ( isInNarrowPaneModal ) {
88308811 Navigation . navigate (
88318812 ROUTES . SEARCH_REPORT . getRoute ( {
8832- reportID : newAncestor . report . reportID ,
8833- reportActionID : newAncestor . reportAction . reportActionID ,
8813+ reportID : ancestor . report . reportID ,
8814+ reportActionID : ancestor . reportAction . reportActionID ,
88348815 backTo : SCREENS . SEARCH . REPORT_RHP ,
88358816 } ) ,
88368817 ) ;
88378818 return ;
88388819 }
88398820
88408821 // Pop the thread report screen before navigating to the chat report.
8841- Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( newAncestor . report . reportID ) ) ;
8822+ Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( ancestor . report . reportID ) ) ;
88428823
8843- const isVisibleAction = shouldReportActionBeVisible ( newAncestor . reportAction , newAncestor . reportAction . reportActionID , canUserPerformWrite ) ;
8824+ const isVisibleAction = shouldReportActionBeVisible ( ancestor . reportAction , ancestor . reportAction . reportActionID , canUserPerformWrite ) ;
88448825
88458826 if ( isVisibleAction && ! isOffline ) {
88468827 // Pop the chat report screen before navigating to the linked report action.
8847- Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( newAncestor . report . reportID , newAncestor . reportAction . reportActionID ) ) ;
8828+ Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( ancestor . report . reportID , ancestor . reportAction . reportActionID ) ) ;
88488829 }
88498830}
88508831
0 commit comments