mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-54260: In Browse Channel Modal fix member count on private channels and when there is only 1 member in the channel (#24452)
This commit is contained in:
parent
060a63a3ed
commit
71fb10ae7a
@ -2312,6 +2312,10 @@ func (s SqlChannelStore) GetChannelsMemberCount(channelIDs []string) (_ map[stri
|
|||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
|
|
||||||
memberCounts := make(map[string]int64)
|
memberCounts := make(map[string]int64)
|
||||||
|
// Initialize member counts for channels with zero members
|
||||||
|
for _, channelID := range channelIDs {
|
||||||
|
memberCounts[channelID] = 0
|
||||||
|
}
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var channelID string
|
var channelID string
|
||||||
var count int64
|
var count int64
|
||||||
|
@ -116,6 +116,7 @@ export default class BrowseChannels extends React.PureComponent<Props, State> {
|
|||||||
return result.data ? result.data.map((channel) => channel.id) : [];
|
return result.data ? result.data.map((channel) => channel.id) : [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
this.props.privateChannels.forEach((channel) => channelIDsForMemberCount.push(channel.id));
|
||||||
if (channelIDsForMemberCount.length > 0) {
|
if (channelIDsForMemberCount.length > 0) {
|
||||||
this.props.actions.getChannelsMemberCount(channelIDsForMemberCount);
|
this.props.actions.getChannelsMemberCount(channelIDsForMemberCount);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user