Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13090,11 +13090,12 @@ function isWaitingForSubmissionFromCurrentUser(chatReport: OnyxEntry<Report>, po
}

function getChatListItemReportName(action: ReportAction & {reportName?: string}, report: Report | undefined, conciergeReportID: string | undefined, translate: LocalizedTranslate): string {
if (report && isInvoiceReport(report)) {
const properInvoiceReport = report;
properInvoiceReport.chatReportID = report.parentReportID;

return getInvoiceReportName(properInvoiceReport, translate);
const reportForHeader = getReportForHeader(report);
if (reportForHeader && isInvoiceReport(reportForHeader)) {
// Search snapshots of invoice reports may only carry `parentReportID` as the invoice room ID, so fall back to it
// when `chatReportID` is missing (without mutating the Onyx report) so `getInvoiceReportName` resolves the NewDot title.
const invoiceReport = reportForHeader.chatReportID ? reportForHeader : {...reportForHeader, chatReportID: reportForHeader.parentReportID};
return getInvoiceReportName(invoiceReport, translate);
}

if (action?.reportName) {
Expand Down
Loading