From 0b6fa7a8830181777dc7297703140d289cf511f5 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Garay <87341702+aldo-expensify@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:32:10 -0700 Subject: [PATCH] Merge pull request #43054 from Expensify/aldo_fix-system-chats Fix system chat participant count (cherry picked from commit d51b3ebb1d0951b594673914ac855b4e7f092a29) --- src/pages/ReportDetailsPage.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 8a3d7da0c884..07523a4d2f92 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -92,11 +92,12 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const isGroupChat = useMemo(() => ReportUtils.isGroupChat(report), [report]); const isThread = useMemo(() => ReportUtils.isThread(report), [report]); const participants = useMemo(() => { - if (isGroupChat || isSystemChat) { - // Filter out the current user from the particpants of the systemChat - return ReportUtils.getParticipantAccountIDs(report.reportID ?? '').filter((accountID) => accountID !== session?.accountID && isSystemChat); + if (isGroupChat) { + return ReportUtils.getParticipantAccountIDs(report.reportID ?? ''); + } + if (isSystemChat) { + return ReportUtils.getParticipantAccountIDs(report.reportID ?? '').filter((accountID) => accountID !== session?.accountID); } - return ReportUtils.getVisibleChatMemberAccountIDs(report.reportID ?? ''); }, [report, session, isGroupChat, isSystemChat]);