getChannelAndMyMember to load profiles for new channel (#25127)

ws preferences change event load profiles for GM on GM show

getChannelAndMyMember user Promise.all

remove changes in getChannelAndMyMember

seperate perfence changes by DM and GM instead of load both
Этот коммит содержится в:
Andrew Delph
2023-10-27 07:12:55 -04:00
коммит произвёл GitHub
родитель b284d40faa
Коммит 678ac22c79

Просмотреть файл

@@ -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,