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
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
9e3b74b4ef
Коммит
bb2ca558bb
@@ -11,7 +11,7 @@ import TeamStore from 'stores/team_store.jsx';
|
|||||||
import SearchStore from 'stores/search_store.jsx';
|
import SearchStore from 'stores/search_store.jsx';
|
||||||
|
|
||||||
import {handleNewPost} from 'actions/post_actions.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 {loadChannelsForCurrentUser} from 'actions/channel_actions.jsx';
|
||||||
import {stopPeriodicStatusUpdates} from 'actions/status_actions.jsx';
|
import {stopPeriodicStatusUpdates} from 'actions/status_actions.jsx';
|
||||||
import * as WebsocketActions from 'actions/websocket_actions.jsx';
|
import * as WebsocketActions from 'actions/websocket_actions.jsx';
|
||||||
@@ -133,6 +133,13 @@ export function emitPostFocusEvent(postId, onSuccess) {
|
|||||||
(data) => {
|
(data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
const channelId = data.posts[data.order[0]].channel_id;
|
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(() => {
|
doFocusPost(channelId, postId, data).then(() => {
|
||||||
if (onSuccess) {
|
if (onSuccess) {
|
||||||
onSuccess();
|
onSuccess();
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user