Этот коммит содержится в:
Christopher Speller
2016-11-24 09:08:46 -05:00
родитель b212acf312 36f62c9e82
Коммит c96ecae6da
15 изменённых файлов: 137 добавлений и 45 удалений

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

@@ -135,6 +135,7 @@ function populateDMChannelsWithProfiles(userIds) {
const currentUserId = UserStore.getCurrentId();
for (let i = 0; i < userIds.length; i++) {
// TODO There's a race condition here for DM channels if those channels aren't loaded yet
const channelName = getDirectChannelName(currentUserId, userIds[i]);
const channel = ChannelStore.getByName(channelName);
if (channel) {

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

@@ -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]);
}
@@ -207,6 +211,11 @@ function handleNewUserEvent(msg) {
return;
}
if (msg.data.user_id === UserStore.getCurrentId()) {
// We should already have ourselves
return;
}
AsyncClient.getUser(msg.data.user_id);
AsyncClient.getChannelStats();
loadProfilesAndTeamMembersForDMSidebar();