From bb2ca558bb8a015ff850aa3887cbbfdc4e14650d Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 30 Aug 2017 16:26:36 -0400 Subject: PLT-7220: Jumping to a GM from a flagged messages doesn't add the GM to your LHS (#7319) * Ensured that DM/GM channel is added to LHS when jump link is clicked in RHS * Moved sidebar channel loading logic into global_actions so that it happens after the users' channels have been loaded * Fixing checkstyle issues --- webapp/actions/global_actions.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'webapp') diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index 0b7c8f7b1..a67d1b751 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -11,7 +11,7 @@ import TeamStore from 'stores/team_store.jsx'; import SearchStore from 'stores/search_store.jsx'; import {handleNewPost} from 'actions/post_actions.jsx'; -import {loadProfilesForSidebar} from 'actions/user_actions.jsx'; +import {loadProfilesForSidebar, loadNewDMIfNeeded, loadNewGMIfNeeded} from 'actions/user_actions.jsx'; import {loadChannelsForCurrentUser} from 'actions/channel_actions.jsx'; import {stopPeriodicStatusUpdates} from 'actions/status_actions.jsx'; import * as WebsocketActions from 'actions/websocket_actions.jsx'; @@ -133,6 +133,13 @@ export function emitPostFocusEvent(postId, onSuccess) { (data) => { if (data) { const channelId = data.posts[data.order[0]].channel_id; + const channel = ChannelStore.getChannelById(channelId); + if (channel && channel.type === Constants.DM_CHANNEL) { + loadNewDMIfNeeded(channel.id); + } else if (channel && channel.type === Constants.GM_CHANNEL) { + loadNewGMIfNeeded(channel.id); + } + doFocusPost(channelId, postId, data).then(() => { if (onSuccess) { onSuccess(); -- cgit v1.2.3-1-g7c22