From 22c77c6df16e635a22d00cdf406e2e217921a995 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 27 Jun 2024 16:34:09 +0800 Subject: [PATCH 1/2] pass the parent report action from params --- src/libs/ReportUtils.ts | 4 ++-- src/pages/home/HeaderView.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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); From 049654630fda6c9a70ff18f8a7b620bf2d474856 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 27 Jun 2024 16:34:18 +0800 Subject: [PATCH 2/2] update last modified optimistically --- src/libs/actions/Report.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index e528fde34ffe..73c2daf1e48e 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1538,6 +1538,7 @@ function editReportComment(reportID: string, originalReportAction: OnyxEntry