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

This commit is contained in:
Harrison Healey
2016-03-31 11:10:57 -04:00
parent 803b58c2d4
commit 307c16df5f
2 changed files with 6 additions and 2 deletions

View File

@@ -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) => {

View File

@@ -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;
}