diff options
Diffstat (limited to 'webapp/actions/user_actions.jsx')
-rw-r--r-- | webapp/actions/user_actions.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx index eacb0df80..8dfc819b9 100644 --- a/webapp/actions/user_actions.jsx +++ b/webapp/actions/user_actions.jsx @@ -24,6 +24,8 @@ import store from 'stores/redux_store.jsx'; const dispatch = store.dispatch; const getState = store.getState; +import * as Selectors from 'mattermost-redux/selectors/entities/users'; + import { getProfiles, getProfilesInChannel, @@ -239,7 +241,8 @@ function populateDMChannelsWithProfiles(userIds) { for (let i = 0; i < userIds.length; i++) { const channelName = getDirectChannelName(currentUserId, userIds[i]); const channel = ChannelStore.getByName(channelName); - if (channel) { + const profilesInChannel = Selectors.getUserIdsInChannels(getState())[channel.id] || new Set(); + if (channel && !profilesInChannel.has(userIds[i])) { UserStore.saveUserIdInChannel(channel.id, userIds[i]); } } |