From 40080239b35e093f4f20ec3f0ccdf58bf8df7d3d Mon Sep 17 00:00:00 2001 From: Pedro Guerreiro Date: Mon, 25 Nov 2024 22:22:03 +0000 Subject: [PATCH] fix: LHN shows unavailable workspace --- src/libs/ReportUtils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 952e0c2fe4cc..82f61f1d2c40 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3043,7 +3043,8 @@ function getMoneyRequestReportName(report: OnyxEntry, policy?: OnyxEntry let payerOrApproverName; if (isExpenseReport(report)) { - payerOrApproverName = getPolicyName(report, false, policy); + const parentReport = getParentReport(report); + payerOrApproverName = getPolicyName(parentReport ?? report, false, policy); } else if (isInvoiceReport(report)) { const chatReport = getReportOrDraftReport(report?.chatReportID); payerOrApproverName = getInvoicePayerName(chatReport, invoiceReceiverPolicy); @@ -3553,7 +3554,8 @@ function getReportPreviewMessage( const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID); const totalAmount = getMoneyRequestSpendBreakdown(report).totalDisplaySpend; - const policyName = getPolicyName(report, false, policy); + const parentReport = getParentReport(report); + const policyName = getPolicyName(parentReport ?? report, false, policy); const payerName = isExpenseReport(report) ? policyName : getDisplayNameForParticipant(report.managerID, !isPreviewMessageForParentChatReport); const formattedAmount = CurrencyUtils.convertToDisplayString(totalAmount, report.currency);