Fixed errors when joining a channel that doesn't exist yet

Этот коммит содержится в:
Harrison Healey
2016-03-31 11:10:57 -04:00
родитель 803b58c2d4
Коммит 307c16df5f
2 изменённых файлов: 6 добавлений и 2 удалений

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

@@ -57,7 +57,11 @@ export default class PopoverListMembers extends React.Component {
const members = this.props.members;
const teamMembers = UserStore.getProfilesUsernameMap();
const currentUserId = UserStore.getCurrentId();
const ch = ChannelStore.getCurrent();
const ch = ChannelStore.get(this.props.channelId);
if (!ch) {
return null;
}
if (members && teamMembers) {
members.sort((a, b) => {

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

@@ -531,8 +531,8 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
switch (action.type) {
case ActionTypes.RECEIVED_POSTS: {
const id = PostStore.currentFocusedPostId == null ? action.id : PostStore.currentFocusedPostId;
PostStore.checkBounds(id, action.numRequested, makePostListNonNull(action.post_list), action.before);
PostStore.storePosts(id, makePostListNonNull(action.post_list));
PostStore.checkBounds(id, action.numRequested, makePostListNonNull(action.post_list), action.before);
PostStore.emitChange();
break;
}