diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-05-04 18:06:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-04 18:06:25 -0400 |
commit | 4951da5232ad2e7257f14c9def998730f9912e49 (patch) | |
tree | 81216000af90bfef1b376323aa2c75492a9e6a99 | |
parent | 85c2d5a478008cfa9030e1bddc23fa91e232a573 (diff) | |
download | chat-4951da5232ad2e7257f14c9def998730f9912e49.tar.gz chat-4951da5232ad2e7257f14c9def998730f9912e49.tar.bz2 chat-4951da5232ad2e7257f14c9def998730f9912e49.zip |
Fix usernames not showing in DM list on first load (#6333)
-rw-r--r-- | webapp/components/sidebar.jsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index b48d5a8f5..aa7b98be0 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -41,7 +41,8 @@ import favicon from 'images/favicon/favicon-16x16.png'; import redFavicon from 'images/favicon/redfavicon-16x16.png'; import store from 'stores/redux_store.jsx'; -import * as Selectors from 'mattermost-redux/selectors/entities/preferences'; +import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; +import {getUsers} from 'mattermost-redux/selectors/entities/users'; export default class Sidebar extends React.Component { constructor(props) { @@ -120,14 +121,18 @@ export default class Sidebar extends React.Component { const tutorialStep = PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 999); const channels = ChannelStore.getAll(); - const preferences = Selectors.getMyPreferences(store.getState()); + const preferences = getMyPreferences(store.getState()); + const profiles = getUsers(store.getState()); let displayableChannels = {}; - if (channels !== this.oldChannels || preferences !== this.oldPreferences) { + if (channels !== this.oldChannels || + preferences !== this.oldPreferences || + profiles !== this.oldProfiles) { const channelsArray = channels.map((channel) => Object.assign({}, channel)); displayableChannels = ChannelUtils.buildDisplayableChannelList(channelsArray); } this.oldChannels = channels; this.oldPreferences = preferences; + this.oldProfiles = profiles; return { activeId: currentChannelId, |