diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index cca52ac37c9d..c2f251df6307 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3318,9 +3318,9 @@ function getInvoicesChatName(report: OnyxEntry): string { /** * Get the title for a report. */ -function getReportName(report: OnyxEntry, policy?: OnyxEntry): string { +function getReportName(report: OnyxEntry, policy?: OnyxEntry, parentReportActionParam?: OnyxInputOrEntry): string { let formattedName: string | undefined; - const parentReportAction = ReportActionsUtils.getParentReportAction(report); + const parentReportAction = parentReportActionParam ?? ReportActionsUtils.getParentReportAction(report); if (isChatThread(report)) { if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isTransactionThread(parentReportAction)) { formattedName = getTransactionReportName(parentReportAction); diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx index 699fbab345cb..6728b37946f6 100644 --- a/src/pages/home/HeaderView.tsx +++ b/src/pages/home/HeaderView.tsx @@ -103,7 +103,7 @@ function HeaderView({ const isTaskReport = ReportUtils.isTaskReport(report); const reportHeaderData = !isTaskReport && !isChatThread && report.parentReportID ? parentReport : report; // Use sorted display names for the title for group chats on native small screen widths - const title = ReportUtils.getReportName(reportHeaderData); + const title = ReportUtils.getReportName(reportHeaderData, undefined, parentReportAction); const subtitle = ReportUtils.getChatRoomSubtitle(reportHeaderData); const parentNavigationSubtitleData = ReportUtils.getParentNavigationSubtitle(reportHeaderData); const isConcierge = ReportUtils.isConciergeChatReport(report);