Skip to content

[Fix]: Number of announce room members does not update when remove workspace members due to pendingAction #39796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 15, 2024
Merged
5 changes: 4 additions & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(report), [report, policy]);
const parentNavigationSubtitleData = ReportUtils.getParentNavigationSubtitle(report);
const participants = useMemo(() => ReportUtils.getVisibleMemberIDs(report), [report]);
const NonpendingChatMembers = report?.participantAccountIDs
?.map((accountID) => report.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString()))
.filter((member) => !member || member.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);

const isGroupDMChat = useMemo(() => ReportUtils.isDM(report) && participants.length > 1, [report, participants.length]);

Expand Down Expand Up @@ -131,7 +134,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
key: CONST.REPORT_DETAILS_MENU_ITEM.MEMBERS,
Copy link
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: NonpendingChatMembers.length,
isAnonymousAction: false,
action: () => {
if (isUserCreatedPolicyRoom || isChatThread) {
Expand Down