Skip to content

Commit

Permalink
Merge pull request #43054 from Expensify/aldo_fix-system-chats
Browse files Browse the repository at this point in the history
Fix system chat participant count

(cherry picked from commit d51b3eb)
  • Loading branch information
aldo-expensify authored and OSBotify committed Jun 4, 2024
1 parent 42fee70 commit 0b6fa7a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit 0b6fa7a

Please sign in to comment.