diff options
Diffstat (limited to 'webapp/routes')
-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(); }, |