mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-54356: In-correct User count when adding members that already exists to the channel (#24540)
* Only add user who isn't in the channel * Update webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> --------- Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
ccfb4a3d74
commit
d08f1ca3fb
@ -1049,6 +1049,8 @@ export function addChannelMember(channelId: string, userId: string, postRootId =
|
|||||||
|
|
||||||
Client4.trackEvent('action', 'action_channels_add_member', {channel_id: channelId});
|
Client4.trackEvent('action', 'action_channels_add_member', {channel_id: channelId});
|
||||||
|
|
||||||
|
const membersInChannel = getState().entities.channels.membersInChannel[channelId];
|
||||||
|
if (!(membersInChannel && userId in membersInChannel)) {
|
||||||
dispatch(batchActions([
|
dispatch(batchActions([
|
||||||
{
|
{
|
||||||
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
|
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
|
||||||
@ -1063,6 +1065,7 @@ export function addChannelMember(channelId: string, userId: string, postRootId =
|
|||||||
id: channelId,
|
id: channelId,
|
||||||
},
|
},
|
||||||
], 'ADD_CHANNEL_MEMBER.BATCH'));
|
], 'ADD_CHANNEL_MEMBER.BATCH'));
|
||||||
|
}
|
||||||
|
|
||||||
return {data: member};
|
return {data: member};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user