From dc911f947a6edcd7eb3bbc81db0c33bfcfc7ac9b Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 2 May 2024 15:24:45 +0800 Subject: [PATCH 1/3] always show the actor display name --- src/libs/OptionsListUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 431cd1a3e820..98e07117e4ef 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -517,7 +517,7 @@ function getAllReportErrors(report: OnyxEntry, reportActions: OnyxEntry< * Get the last actor display name from last actor details. */ function getLastActorDisplayName(lastActorDetails: Partial | null, hasMultipleParticipants: boolean) { - return hasMultipleParticipants && lastActorDetails && lastActorDetails.accountID !== currentUserAccountID + return hasMultipleParticipants && lastActorDetails ? // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing lastActorDetails.firstName || PersonalDetailsUtils.getDisplayNameOrDefault(lastActorDetails) : ''; From 5295cff0bda5b09ce62e25fca600116b35fbb7a8 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 4 May 2024 22:15:13 +0800 Subject: [PATCH 2/3] add back current user check --- src/libs/OptionsListUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 7a1396722e6a..b599fdc6d0f1 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -527,7 +527,7 @@ function getAllReportErrors(report: OnyxEntry, reportActions: OnyxEntry< * Get the last actor display name from last actor details. */ function getLastActorDisplayName(lastActorDetails: Partial | null, hasMultipleParticipants: boolean) { - return hasMultipleParticipants && lastActorDetails + return hasMultipleParticipants && lastActorDetails && lastActorDetails.accountID !== currentUserAccountID ? // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing lastActorDetails.firstName || PersonalDetailsUtils.getDisplayNameOrDefault(lastActorDetails) : ''; From d63b5a656074401d50e30cac42b25ac6e7105866 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 4 May 2024 22:27:49 +0800 Subject: [PATCH 3/3] optimistically set the last actor account ID --- src/libs/actions/IOU.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index e0b406ad9c45..c884794029e8 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -3667,6 +3667,7 @@ function createSplitsAndOnyxData( splitChatReport.lastReadTime = DateUtils.getDBTime(); splitChatReport.lastMessageText = splitIOUReportAction.message?.[0]?.text; splitChatReport.lastMessageHtml = splitIOUReportAction.message?.[0]?.html; + splitChatReport.lastActorAccountID = currentUserAccountID; let splitChatReportNotificationPreference = splitChatReport.notificationPreference; if (splitChatReportNotificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) {