diff --git a/src/libs/ReportNameUtils.ts b/src/libs/ReportNameUtils.ts index dbc2aa26cc1e0..d0daa699a441f 100644 --- a/src/libs/ReportNameUtils.ts +++ b/src/libs/ReportNameUtils.ts @@ -725,12 +725,9 @@ function computeReportName( if (!report || !report.reportID) { return ''; } - const privateIsArchivedValue = privateIsArchived ?? allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]?.private_isArchived; - const reportPolicy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`]; - const isArchivedNonExpense = isArchivedNonExpenseReport(report, !!privateIsArchivedValue); - + const reportPolicy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`]; const parentReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`]; const parentReportAction = isThread(report) ? reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.parentReportID}`]?.[report.parentReportActionID] : undefined; @@ -741,6 +738,10 @@ function computeReportName( return parentReportActionBasedName; } + if (report?.reportName && report.type === CONST.REPORT.TYPE.EXPENSE) { + return isArchivedNonExpense ? generateArchivedReportName(report?.reportName) : report?.reportName; + } + if (isTaskReport(report)) { return Parser.htmlToText(report?.reportName ?? '').trim(); }