Fix sidebar status not updating (#6752)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
227586e09a
Коммит
bef07fc53e
@@ -45,7 +45,7 @@ const dispatch = store.dispatch;
|
|||||||
const getState = store.getState;
|
const getState = store.getState;
|
||||||
|
|
||||||
import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences';
|
import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences';
|
||||||
import {getUsers} from 'mattermost-redux/selectors/entities/users';
|
import {getUsers, getUserStatuses} from 'mattermost-redux/selectors/entities/users';
|
||||||
import {savePreferences} from 'mattermost-redux/actions/preferences';
|
import {savePreferences} from 'mattermost-redux/actions/preferences';
|
||||||
|
|
||||||
export default class Sidebar extends React.Component {
|
export default class Sidebar extends React.Component {
|
||||||
@@ -108,10 +108,12 @@ export default class Sidebar extends React.Component {
|
|||||||
const channels = ChannelStore.getAll();
|
const channels = ChannelStore.getAll();
|
||||||
const preferences = getMyPreferences(store.getState());
|
const preferences = getMyPreferences(store.getState());
|
||||||
const profiles = getUsers(store.getState());
|
const profiles = getUsers(store.getState());
|
||||||
|
const statuses = getUserStatuses(store.getState());
|
||||||
let displayableChannels = {};
|
let displayableChannels = {};
|
||||||
if (!Utils.areObjectsEqual(channels, this.oldChannels) ||
|
if (!Utils.areObjectsEqual(channels, this.oldChannels) ||
|
||||||
!Utils.areObjectsEqual(preferences, this.oldPreferences) ||
|
!Utils.areObjectsEqual(preferences, this.oldPreferences) ||
|
||||||
!Utils.areObjectsEqual(profiles, this.oldProfiles)) {
|
!Utils.areObjectsEqual(profiles, this.oldProfiles) ||
|
||||||
|
!Utils.areObjectsEqual(statuses, this.oldStatuses)) {
|
||||||
const channelsArray = channels.map((channel) => Object.assign({}, channel));
|
const channelsArray = channels.map((channel) => Object.assign({}, channel));
|
||||||
displayableChannels = ChannelUtils.buildDisplayableChannelList(channelsArray);
|
displayableChannels = ChannelUtils.buildDisplayableChannelList(channelsArray);
|
||||||
displayableChannels.favoriteChannels.sort(sortTeamsByDisplayName);
|
displayableChannels.favoriteChannels.sort(sortTeamsByDisplayName);
|
||||||
@@ -119,6 +121,7 @@ export default class Sidebar extends React.Component {
|
|||||||
this.oldChannels = channels;
|
this.oldChannels = channels;
|
||||||
this.oldPreferences = preferences;
|
this.oldPreferences = preferences;
|
||||||
this.oldProfiles = profiles;
|
this.oldProfiles = profiles;
|
||||||
|
this.oldStatuses = statuses;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
activeId: currentChannelId,
|
activeId: currentChannelId,
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user