From ced292ae49725227d4963a121915f8063bec2b35 Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Mon, 12 Feb 2024 14:02:59 +0100 Subject: [PATCH 1/3] fix: display actor name for group chat --- src/libs/SidebarUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 2347f5b9f5c5..37f3fdc7672f 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -412,7 +412,7 @@ function getOptionData({ .join(' '); } - result.alternateText = lastMessageText || formattedLogin; + result.alternateText = hasMultipleParticipants && lastActorDisplayName ? `${lastActorDisplayName}: ${lastMessageText}` : lastMessageText || formattedLogin; } result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result as Report); From 9e9a13eadea85d6c3cac7bcd4df687c0c11f5719 Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Fri, 16 Feb 2024 16:54:15 +0100 Subject: [PATCH 2/3] fix: display actor name only for group chats --- src/libs/SidebarUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 0ae3468f3124..5d74dcb319eb 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -388,7 +388,7 @@ function getOptionData({ .join(' '); } - result.alternateText = hasMultipleParticipants && lastActorDisplayName ? `${lastActorDisplayName}: ${lastMessageText}` : lastMessageText || formattedLogin; + result.alternateText = ReportUtils.isGroupChat(report) && lastActorDisplayName ? `${lastActorDisplayName}: ${lastMessageText}` : lastMessageText || formattedLogin; } result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result as Report); From 1ec1ad30418e3be45c5bff7d924efa1b432478ad Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Fri, 16 Feb 2024 18:48:47 +0100 Subject: [PATCH 3/3] fix: change the condition for group chats --- 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 b5da21c0f67e..93cd68938075 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4676,7 +4676,7 @@ function isGroupChat(report: OnyxEntry): boolean { !isMoneyRequestReport(report) && !isArchivedRoom(report) && !Object.values(CONST.REPORT.CHAT_TYPE).some((chatType) => chatType === getChatType(report)) && - (report.participantAccountIDs?.length ?? 0) > 2, + (report.participantAccountIDs?.length ?? 0) > 1, ); }