From 2cc73acc278e789829e8453f472f5718a20202a0 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 27 May 2024 15:42:14 +0700 Subject: [PATCH 1/2] fix: Transaction report shows multiline title for expense with multiline description --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f15eb3ee001e..df291146b11c 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3153,7 +3153,7 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu if (isArchivedRoom(report)) { formattedName += ` (${Localize.translateLocal('common.archived')})`; } - return formattedName; + return formattedName.replace(/(\r\n|\n|\r)/gm, ' '); } if (parentReportAction?.message?.[0]?.isDeletedParentAction) { From 652c8b26758f014c7169737bd2965190a020dcba Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Thu, 30 May 2024 18:36:03 +0700 Subject: [PATCH 2/2] use formatReportLastMessageText function --- src/libs/ReportUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 86cf74934104..220a6176b784 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3161,7 +3161,7 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu if (isArchivedRoom(report)) { formattedName += ` (${Localize.translateLocal('common.archived')})`; } - return formattedName.replace(/(\r\n|\n|\r)/gm, ' '); + return formatReportLastMessageText(formattedName); } if (parentReportAction?.message?.[0]?.isDeletedParentAction) { @@ -3229,7 +3229,7 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu } if (formattedName) { - return formattedName; + return formatReportLastMessageText(formattedName); } // Not a room or PolicyExpenseChat, generate title from first 5 other participants