@@ -90,6 +90,12 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
90
90
return ReportUtils . getVisibleChatMemberAccountIDs ( report . reportID ?? '' ) ;
91
91
} , [ report , isGroupChat ] ) ;
92
92
93
+ // Get the active chat members by filtering out the pending members with delete action
94
+ const activeChatMembers = participants . flatMap ( ( accountID ) => {
95
+ const pendingMember = report ?. pendingChatMembers ?. findLast ( ( member ) => member . accountID === accountID . toString ( ) ) ;
96
+ return ! pendingMember || pendingMember . pendingAction !== CONST . RED_BRICK_ROAD_PENDING_ACTION . DELETE ? accountID : [ ] ;
97
+ } ) ;
98
+
93
99
const isGroupDMChat = useMemo ( ( ) => ReportUtils . isDM ( report ) && participants . length > 1 , [ report , participants . length ] ) ;
94
100
const isPrivateNotesFetchTriggered = report ?. isLoadingPrivateNotes !== undefined ;
95
101
@@ -140,7 +146,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
140
146
key : CONST . REPORT_DETAILS_MENU_ITEM . MEMBERS ,
141
147
translationKey : 'common.members' ,
142
148
icon : Expensicons . Users ,
143
- subtitle : participants . length ,
149
+ subtitle : activeChatMembers . length ,
144
150
isAnonymousAction : false ,
145
151
action : ( ) => {
146
152
if ( isUserCreatedPolicyRoom || isChatThread ) {
@@ -200,6 +206,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
200
206
session ,
201
207
isSelfDM ,
202
208
isDefaultRoom ,
209
+ activeChatMembers . length ,
203
210
isGroupChat ,
204
211
] ) ;
205
212
0 commit comments