From bef07fc53eb5cf77ee152a24de002b9289503a4a Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 29 Jun 2017 09:37:57 -0400 Subject: Fix sidebar status not updating (#6752) --- webapp/components/sidebar.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'webapp') diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 040f12c26..8c959c397 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -45,7 +45,7 @@ const dispatch = store.dispatch; const getState = store.getState; 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'; export default class Sidebar extends React.Component { @@ -108,10 +108,12 @@ export default class Sidebar extends React.Component { const channels = ChannelStore.getAll(); const preferences = getMyPreferences(store.getState()); const profiles = getUsers(store.getState()); + const statuses = getUserStatuses(store.getState()); let displayableChannels = {}; if (!Utils.areObjectsEqual(channels, this.oldChannels) || !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)); displayableChannels = ChannelUtils.buildDisplayableChannelList(channelsArray); displayableChannels.favoriteChannels.sort(sortTeamsByDisplayName); @@ -119,6 +121,7 @@ export default class Sidebar extends React.Component { this.oldChannels = channels; this.oldPreferences = preferences; this.oldProfiles = profiles; + this.oldStatuses = statuses; return { activeId: currentChannelId, -- cgit v1.2.3-1-g7c22