diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-02-15 18:54:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-15 18:54:24 -0500 |
commit | db2966b7cb3111ff1b3cadfbec1221343b0e8629 (patch) | |
tree | e2b64183860e98807a4d77401db3dcdf61d2a6a7 /webapp/routes/route_team.jsx | |
parent | 745e2f4923c653c7b9bff990375d9f3f67b4c212 (diff) | |
download | chat-db2966b7cb3111ff1b3cadfbec1221343b0e8629.tar.gz chat-db2966b7cb3111ff1b3cadfbec1221343b0e8629.tar.bz2 chat-db2966b7cb3111ff1b3cadfbec1221343b0e8629.zip |
Remove MakeDirectChannelVisible and add client handling for showing DMs (#5430)
Diffstat (limited to 'webapp/routes/route_team.jsx')
-rw-r--r-- | webapp/routes/route_team.jsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/webapp/routes/route_team.jsx b/webapp/routes/route_team.jsx index cacb8dd20..44a8c1eb6 100644 --- a/webapp/routes/route_team.jsx +++ b/webapp/routes/route_team.jsx @@ -13,6 +13,7 @@ import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; import Constants from 'utils/constants.jsx'; const ActionTypes = Constants.ActionTypes; import * as AsyncClient from 'utils/async_client.jsx'; +import * as Utils from 'utils/utils.jsx'; import Client from 'client/web_client.jsx'; import ChannelStore from 'stores/channel_store.jsx'; import BrowserStore from 'stores/browser_store.jsx'; @@ -20,7 +21,7 @@ import BrowserStore from 'stores/browser_store.jsx'; import emojiRoute from 'routes/route_emoji.jsx'; import integrationsRoute from 'routes/route_integrations.jsx'; -import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx'; +import {loadNewDMIfNeeded, loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx'; function onChannelEnter(nextState, replace, callback) { doChannelChange(nextState, replace, callback); @@ -33,6 +34,10 @@ function doChannelChange(state, replace, callback) { } else { channel = ChannelStore.getByName(state.params.channel); + if (channel.type === Constants.DM_CHANNEL) { + loadNewDMIfNeeded(Utils.getUserIdFromChannelName(channel)); + } + if (!channel) { Client.joinChannelByName( state.params.channel, @@ -100,7 +105,6 @@ function preNeedsTeam(nextState, replace, callback) { if (nextState.location.pathname.indexOf('/channels/') > -1 || nextState.location.pathname.indexOf('/pl/') > -1) { - loadProfilesAndTeamMembersForDMSidebar(); AsyncClient.getMyTeamsUnread(); const teams = TeamStore.getAll(); for (const id in teams) { @@ -120,6 +124,7 @@ function preNeedsTeam(nextState, replace, callback) { }); loadStatusesForChannelAndSidebar(); + loadProfilesAndTeamMembersForDMSidebar(); d1.resolve(); }, |