@@ -34,6 +34,7 @@ import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
3434import Navigation from '@libs/Navigation/Navigation' ;
3535import { getPersonalDetailsForAccountIDs } from '@libs/OptionsListUtils' ;
3636import Parser from '@libs/Parser' ;
37+ import { getOneTransactionThreadReportID , getReportActions } from '@libs/ReportActionsUtils' ;
3738import {
3839 canJoinChat ,
3940 canUserPerformWriteAction ,
@@ -46,6 +47,7 @@ import {
4647 getPolicyName ,
4748 getReportDescription ,
4849 getReportName ,
50+ getReportOrDraftReport ,
4951 hasReportNameError ,
5052 isAdminRoom ,
5153 isArchivedReport ,
@@ -54,10 +56,8 @@ import {
5456 isChatUsedForOnboarding as isChatUsedForOnboardingReportUtils ,
5557 isCurrentUserSubmitter ,
5658 isDeprecatedGroupDM ,
57- isExpenseReport ,
5859 isExpenseRequest ,
5960 isGroupChat as isGroupChatReportUtils ,
60- isIOUReport ,
6161 isOpenTaskReport ,
6262 isPolicyExpenseChat as isPolicyExpenseChatReportUtils ,
6363 isSelfDM as isSelfDMReportUtils ,
@@ -140,7 +140,10 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
140140 const isTaskReport = isTaskReportReportUtils ( report ) ;
141141 const [ parentOfParentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ parentReport ?. parentReportID } ` , { canBeMissing : true } ) ;
142142 const reportHeaderData =
143- ( ( ! isTaskReport && ! isChatThread ) || ( parentOfParentReport && ( isIOUReport ( parentOfParentReport ) || isExpenseReport ( parentOfParentReport ) ) ) ) && report ?. parentReportID
143+ ( ( ! isTaskReport && ! isChatThread ) ||
144+ ( parentOfParentReport &&
145+ ! ! getOneTransactionThreadReportID ( parentOfParentReport , getReportOrDraftReport ( parentOfParentReport ?. chatReportID ) , getReportActions ( parentOfParentReport ) ) ) ) &&
146+ report ?. parentReportID
144147 ? parentReport
145148 : report ;
146149 // Use sorted display names for the title for group chats on native small screen widths
0 commit comments