diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index b828ad1f17e4..e3708126322f 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2666,11 +2666,13 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu return formattedName; } - // Not a room or PolicyExpenseChat, generate title from participants - const participantAccountIDs = report?.participantAccountIDs ?? []; + // Not a room or PolicyExpenseChat, generate title from first 5 other participants + const participantAccountIDs = report?.participantAccountIDs?.slice(0, 6) ?? []; const participantsWithoutCurrentUser = participantAccountIDs.filter((accountID) => accountID !== currentUserAccountID); const isMultipleParticipantReport = participantsWithoutCurrentUser.length > 1; - + if (participantsWithoutCurrentUser.length > 5) { + participantsWithoutCurrentUser.pop(); + } return participantsWithoutCurrentUser.map((accountID) => getDisplayNameForParticipant(accountID, isMultipleParticipantReport)).join(', '); }