@@ -8818,39 +8818,25 @@ function isMoneyRequestReportPendingDeletion(reportOrID: OnyxEntry<Report> | str
88188818}
88198819
88208820function navigateToLinkedReportAction ( ancestor : Ancestor , isInNarrowPaneModal : boolean , canUserPerformWrite : boolean | undefined , isOffline : boolean ) {
8821- const parentReport = getReportOrDraftReport ( ancestor . report . parentReportID ) ;
8822- const parentReportAction = getReportAction ( ancestor . report . parentReportID , ancestor . report . parentReportActionID ) ;
8823-
8824- let newAncestor = ancestor ;
8825- // If `parentReport` is an IOU or Expense report, navigate directly to `parentReport`,
8826- // preventing redundant navigation when threading back to the parent chat thread
8827- if ( parentReport && parentReportAction && ( isIOUReport ( parentReport ) || isExpenseReport ( parentReport ) ) ) {
8828- newAncestor = {
8829- ...ancestor ,
8830- report : parentReport ,
8831- reportAction : parentReportAction ,
8832- } ;
8833- }
8834-
88358821 if ( isInNarrowPaneModal ) {
88368822 Navigation . navigate (
88378823 ROUTES . SEARCH_REPORT . getRoute ( {
8838- reportID : newAncestor . report . reportID ,
8839- reportActionID : newAncestor . reportAction . reportActionID ,
8824+ reportID : ancestor . report . reportID ,
8825+ reportActionID : ancestor . reportAction . reportActionID ,
88408826 backTo : SCREENS . SEARCH . REPORT_RHP ,
88418827 } ) ,
88428828 ) ;
88438829 return ;
88448830 }
88458831
88468832 // Pop the thread report screen before navigating to the chat report.
8847- Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( newAncestor . report . reportID ) ) ;
8833+ Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( ancestor . report . reportID ) ) ;
88488834
8849- const isVisibleAction = shouldReportActionBeVisible ( newAncestor . reportAction , newAncestor . reportAction . reportActionID , canUserPerformWrite ) ;
8835+ const isVisibleAction = shouldReportActionBeVisible ( ancestor . reportAction , ancestor . reportAction . reportActionID , canUserPerformWrite ) ;
88508836
88518837 if ( isVisibleAction && ! isOffline ) {
88528838 // Pop the chat report screen before navigating to the linked report action.
8853- Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( newAncestor . report . reportID , newAncestor . reportAction . reportActionID ) ) ;
8839+ Navigation . goBack ( ROUTES . REPORT_WITH_ID . getRoute ( ancestor . report . reportID , ancestor . reportAction . reportActionID ) ) ;
88548840 }
88558841}
88568842
0 commit comments