summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-03-31 12:47:04 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-03-31 12:47:04 -0400
commit720947e17e4e7820dcae6c5e25b5fe8485a7fc6c (patch)
tree8ca959e5014791aaaed94ca541d0b94c4511fcd2 /webapp/components
parent7dee877c191022560c5eb93582e02370071285fe (diff)
parent098873e667126ad2e52bc6b61a1ad4e428c56ace (diff)
downloadchat-720947e17e4e7820dcae6c5e25b5fe8485a7fc6c.tar.gz
chat-720947e17e4e7820dcae6c5e25b5fe8485a7fc6c.tar.bz2
chat-720947e17e4e7820dcae6c5e25b5fe8485a7fc6c.zip
Merge pull request #2595 from hmhealey/plt2480
PLT-2480 Fixed errors when joining a channel that doesn't exist yet
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/channel_header.jsx2
-rw-r--r--webapp/components/popover_list_members.jsx9
-rw-r--r--webapp/components/posts_view.jsx1
3 files changed, 5 insertions, 7 deletions
diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx
index 6bb466c3e..482aabc01 100644
--- a/webapp/components/channel_header.jsx
+++ b/webapp/components/channel_header.jsx
@@ -216,9 +216,9 @@ export default class ChannelHeader extends React.Component {
if (!isDirect) {
popoverListMembers = (
<PopoverListMembers
+ channel={channel}
members={this.state.users}
memberCount={this.state.userCount}
- channelId={channel.id}
/>
);
}
diff --git a/webapp/components/popover_list_members.jsx b/webapp/components/popover_list_members.jsx
index cd583e4c3..226a1889c 100644
--- a/webapp/components/popover_list_members.jsx
+++ b/webapp/components/popover_list_members.jsx
@@ -9,8 +9,6 @@ import * as Utils from 'utils/utils.jsx';
import * as GlobalActions from 'action_creators/global_actions.jsx';
import Constants from 'utils/constants.jsx';
-import ChannelStore from 'stores/channel_store.jsx';
-
import {FormattedMessage} from 'react-intl';
import React from 'react';
@@ -57,7 +55,6 @@ export default class PopoverListMembers extends React.Component {
const members = this.props.members;
const teamMembers = UserStore.getProfilesUsernameMap();
const currentUserId = UserStore.getCurrentId();
- const ch = ChannelStore.getCurrent();
if (members && teamMembers) {
members.sort((a, b) => {
@@ -69,7 +66,7 @@ export default class PopoverListMembers extends React.Component {
members.forEach((m, i) => {
let button = '';
- if (currentUserId !== m.id && ch.type !== 'D') {
+ if (currentUserId !== m.id && this.props.channel.type !== 'D') {
button = (
<a
href='#'
@@ -177,7 +174,7 @@ export default class PopoverListMembers extends React.Component {
}
PopoverListMembers.propTypes = {
+ channel: React.PropTypes.object.isRequired,
members: React.PropTypes.array.isRequired,
- memberCount: React.PropTypes.number,
- channelId: React.PropTypes.string.isRequired
+ memberCount: React.PropTypes.number
};
diff --git a/webapp/components/posts_view.jsx b/webapp/components/posts_view.jsx
index af849fc4a..917411549 100644
--- a/webapp/components/posts_view.jsx
+++ b/webapp/components/posts_view.jsx
@@ -374,6 +374,7 @@ export default class PostsView extends React.Component {
componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
this.scrollStopAction.cancel();
+ PreferenceStore.removeChangeListener(this.updateState);
}
componentDidUpdate() {
if (this.props.postList != null) {