Properly load profile for new posts that have unloaded users (#4578)

Этот коммит содержится в:
Joram Wilander
2016-11-21 12:17:21 -05:00
коммит произвёл Harrison Healey
родитель 3f19ccf1b1
Коммит 50ab9626eb
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@@ -18,7 +18,7 @@ import * as Utils from 'utils/utils.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import {handleNewPost, loadPosts} from 'actions/post_actions.jsx';
import {handleNewPost, loadPosts, loadProfilesForPosts} from 'actions/post_actions.jsx';
import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx';
import {loadChannelsForCurrentUser} from 'actions/channel_actions.jsx';
import * as StatusActions from 'actions/status_actions.jsx';
@@ -172,6 +172,10 @@ function handleNewPostEvent(msg) {
const post = JSON.parse(msg.data.post);
handleNewPost(post, msg);
const posts = {};
posts[post.id] = post;
loadProfilesForPosts(posts);
if (UserStore.getStatus(post.user_id) !== UserStatuses.ONLINE) {
StatusActions.loadStatusesByIds([post.user_id]);
}