From f95ac4e096b272dfd68cf9df058479e38f56c1dd Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Tue, 4 Jun 2024 11:27:06 -0700 Subject: [PATCH] Fix system chat participant count --- 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]);