diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index c1f44785c5ca..6cb37b57a431 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1857,7 +1857,14 @@ function getActorNameForPreviewMessage({report, actorID, shouldShowWorkspaceName * @param {Object} [policy] * @returns {String} */ -function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceiptBeingScanned = false, isPreviewMessageForParentChatReport = false, shouldHideParticipantName = false, policy = undefined) { +function getReportPreviewMessage( + report, + reportAction = {}, + shouldConsiderReceiptBeingScanned = false, + isPreviewMessageForParentChatReport = false, + shouldHideParticipantName = false, + policy = undefined, +) { const reportActionMessage = lodashGet(reportAction, 'message[0].html', ''); if (_.isEmpty(report) || !report.reportID) { @@ -1886,7 +1893,7 @@ function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceip actorID: report.managerID, shouldUseShortForm: true, shouldShowWorkspaceName: isExpenseReport(report), - policy + policy, }); const payerName = shouldHideParticipantName ? '' : payerDisplayName; const formattedAmount = CurrencyUtils.convertToDisplayString(totalAmount, report.currency); diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 763a0000ba35..c3312ebebae9 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -406,7 +406,8 @@ function getOptionData( } : null; } - const lastActorDisplayName = hasMultipleParticipants && lastActorDetails?.accountID && Number(lastActorDetails.accountID) !== currentUserAccountID ? lastActorDetails.displayName : ''; + const lastActorDisplayName = + hasMultipleParticipants && lastActorDetails?.accountID && Number(lastActorDetails.accountID) !== currentUserAccountID ? lastActorDetails.displayName?.split(' ')[0] : ''; let lastMessageText = lastMessageTextFromReport; const reportAction = lastReportActions?.[report.reportID];