Skip to content

Commit 64df8e5

Browse files
authored
Merge pull request Expensify#79397 from s77rt/group-solo-welcome-message
Chat welcome message: Exclude current user only if not only one
2 parents 6883151 + 2ca3e74 commit 64df8e5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/ReportWelcomeText.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
121121

122122
return translate('reportActionsView.sayHello');
123123
}, [isChatRoom, isInvoiceRoom, isPolicyExpenseChat, isSelfDM, isSystemChat, translate, policyName, reportName]);
124-
const participantAccountIDsExcludeCurrentUser = getParticipantsAccountIDsForDisplay(report, undefined, undefined, true);
124+
125+
// If we are the only participant (e.g. solo group chat) then keep the current user personal details so the welcome message does not show up empty.
126+
const shouldExcludeCurrentUser = participantAccountIDs.length > 0;
127+
const participantAccountIDsExcludeCurrentUser = getParticipantsAccountIDsForDisplay(report, undefined, undefined, shouldExcludeCurrentUser);
125128
const participantPersonalDetailListExcludeCurrentUser = Object.values(
126129
getPersonalDetailsForAccountIDs(participantAccountIDsExcludeCurrentUser, personalDetails as OnyxInputOrEntry<PersonalDetailsList>),
127130
);

0 commit comments

Comments
 (0)