Skip to content

Commit

Permalink
pass the parent report action from params
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jun 27, 2024
1 parent 050641a commit 22c77c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3318,9 +3318,9 @@ function getInvoicesChatName(report: OnyxEntry<Report>): string {
/**
* Get the title for a report.
*/
function getReportName(report: OnyxEntry<Report>, policy?: OnyxEntry<Policy>): string {
function getReportName(report: OnyxEntry<Report>, policy?: OnyxEntry<Policy>, parentReportActionParam?: OnyxInputOrEntry<ReportAction>): 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);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 22c77c6

Please sign in to comment.