Merge pull request #2595 from hmhealey/plt2480
PLT-2480 Fixed errors when joining a channel that doesn't exist yet
Этот коммит содержится в:
@@ -216,9 +216,9 @@ export default class ChannelHeader extends React.Component {
|
|||||||
if (!isDirect) {
|
if (!isDirect) {
|
||||||
popoverListMembers = (
|
popoverListMembers = (
|
||||||
<PopoverListMembers
|
<PopoverListMembers
|
||||||
|
channel={channel}
|
||||||
members={this.state.users}
|
members={this.state.users}
|
||||||
memberCount={this.state.userCount}
|
memberCount={this.state.userCount}
|
||||||
channelId={channel.id}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import * as Utils from 'utils/utils.jsx';
|
|||||||
import * as GlobalActions from 'action_creators/global_actions.jsx';
|
import * as GlobalActions from 'action_creators/global_actions.jsx';
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
|
||||||
import ChannelStore from 'stores/channel_store.jsx';
|
|
||||||
|
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@@ -57,7 +55,6 @@ export default class PopoverListMembers extends React.Component {
|
|||||||
const members = this.props.members;
|
const members = this.props.members;
|
||||||
const teamMembers = UserStore.getProfilesUsernameMap();
|
const teamMembers = UserStore.getProfilesUsernameMap();
|
||||||
const currentUserId = UserStore.getCurrentId();
|
const currentUserId = UserStore.getCurrentId();
|
||||||
const ch = ChannelStore.getCurrent();
|
|
||||||
|
|
||||||
if (members && teamMembers) {
|
if (members && teamMembers) {
|
||||||
members.sort((a, b) => {
|
members.sort((a, b) => {
|
||||||
@@ -69,7 +66,7 @@ export default class PopoverListMembers extends React.Component {
|
|||||||
|
|
||||||
members.forEach((m, i) => {
|
members.forEach((m, i) => {
|
||||||
let button = '';
|
let button = '';
|
||||||
if (currentUserId !== m.id && ch.type !== 'D') {
|
if (currentUserId !== m.id && this.props.channel.type !== 'D') {
|
||||||
button = (
|
button = (
|
||||||
<a
|
<a
|
||||||
href='#'
|
href='#'
|
||||||
@@ -177,7 +174,7 @@ export default class PopoverListMembers extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PopoverListMembers.propTypes = {
|
PopoverListMembers.propTypes = {
|
||||||
|
channel: React.PropTypes.object.isRequired,
|
||||||
members: React.PropTypes.array.isRequired,
|
members: React.PropTypes.array.isRequired,
|
||||||
memberCount: React.PropTypes.number,
|
memberCount: React.PropTypes.number
|
||||||
channelId: React.PropTypes.string.isRequired
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -374,6 +374,7 @@ export default class PostsView extends React.Component {
|
|||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
window.removeEventListener('resize', this.handleResize);
|
window.removeEventListener('resize', this.handleResize);
|
||||||
this.scrollStopAction.cancel();
|
this.scrollStopAction.cancel();
|
||||||
|
PreferenceStore.removeChangeListener(this.updateState);
|
||||||
}
|
}
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
if (this.props.postList != null) {
|
if (this.props.postList != null) {
|
||||||
|
|||||||
@@ -531,8 +531,8 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ActionTypes.RECEIVED_POSTS: {
|
case ActionTypes.RECEIVED_POSTS: {
|
||||||
const id = PostStore.currentFocusedPostId == null ? action.id : PostStore.currentFocusedPostId;
|
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.storePosts(id, makePostListNonNull(action.post_list));
|
||||||
|
PostStore.checkBounds(id, action.numRequested, makePostListNonNull(action.post_list), action.before);
|
||||||
PostStore.emitChange();
|
PostStore.emitChange();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user