Skip to content
Merged
9 changes: 8 additions & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
return ReportUtils.getVisibleChatMemberAccountIDs(report.reportID ?? '');
}, [report, isGroupChat]);

// Get the active chat members by filtering out the pending members with delete action
const activeChatMembers = participants.flatMap((accountID) => {
const pendingMember = report?.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString());
return !pendingMember || pendingMember.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? accountID : [];
});
Comment on lines +95 to +97
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not filter out the accountID that is not available in the personalDetails object. This resulted in #46670


const isGroupDMChat = useMemo(() => ReportUtils.isDM(report) && participants.length > 1, [report, participants.length]);
const isPrivateNotesFetchTriggered = report?.isLoadingPrivateNotes !== undefined;

Expand Down Expand Up @@ -140,7 +146,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
key: CONST.REPORT_DETAILS_MENU_ITEM.MEMBERS,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check for activeChatMembers length before rendering members subitem. More details here. #61588

translationKey: 'common.members',
icon: Expensicons.Users,
subtitle: participants.length,
subtitle: activeChatMembers.length,
isAnonymousAction: false,
action: () => {
if (isUserCreatedPolicyRoom || isChatThread) {
Expand Down Expand Up @@ -200,6 +206,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
session,
isSelfDM,
isDefaultRoom,
activeChatMembers.length,
isGroupChat,
]);

Expand Down