diff --git a/webapp/channels/src/actions/websocket_actions.jsx b/webapp/channels/src/actions/websocket_actions.jsx index 2999b3f798..254c0bbafe 100644 --- a/webapp/channels/src/actions/websocket_actions.jsx +++ b/webapp/channels/src/actions/websocket_actions.jsx @@ -101,7 +101,7 @@ import {sendDesktopNotification} from 'actions/notification_actions.jsx'; import {handleNewPost} from 'actions/post_actions'; import * as StatusActions from 'actions/status_actions'; import {setGlobalItem} from 'actions/storage'; -import {loadProfilesForSidebar} from 'actions/user_actions'; +import {loadProfilesForDM, loadProfilesForGM} from 'actions/user_actions'; import {syncPostsInChannel} from 'actions/views/channel'; import {setGlobalDraft, transformServerDraft} from 'actions/views/drafts'; import {openModal} from 'actions/views/modals'; @@ -1233,7 +1233,11 @@ function handlePreferenceChangedEvent(msg) { dispatch({type: PreferenceTypes.RECEIVED_PREFERENCES, data: [preference]}); if (addedNewDmUser(preference)) { - loadProfilesForSidebar(); + loadProfilesForDM(); + } + + if (addedNewGmUser(preference)) { + loadProfilesForGM(); } } @@ -1242,7 +1246,11 @@ function handlePreferencesChangedEvent(msg) { dispatch({type: PreferenceTypes.RECEIVED_PREFERENCES, data: preferences}); if (preferences.findIndex(addedNewDmUser) !== -1) { - loadProfilesForSidebar(); + loadProfilesForDM(); + } + + if (preferences.findIndex(addedNewGmUser) !== -1) { + loadProfilesForGM(); } } @@ -1255,6 +1263,10 @@ function addedNewDmUser(preference) { return preference.category === Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW && preference.value === 'true'; } +function addedNewGmUser(preference) { + return preference.category === Constants.Preferences.CATEGORY_GROUP_CHANNEL_SHOW && preference.value === 'true'; +} + function handleStatusChangedEvent(msg) { dispatch({ type: UserTypes.RECEIVED_STATUSES,