diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-31 13:01:05 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-31 13:01:05 -0400 |
commit | 36f611fac48536f26770357de8d5b6767bd46d2f (patch) | |
tree | b92ca8dc6e9593eee054f7bd73e185735b6a6209 /webapp/components/channel_view.jsx | |
parent | 720947e17e4e7820dcae6c5e25b5fe8485a7fc6c (diff) | |
parent | 54a064de98f43c55bed429867493e6f5c7e97379 (diff) | |
download | chat-36f611fac48536f26770357de8d5b6767bd46d2f.tar.gz chat-36f611fac48536f26770357de8d5b6767bd46d2f.tar.bz2 chat-36f611fac48536f26770357de8d5b6767bd46d2f.zip |
Merge pull request #2594 from mattermost/plt-2476
PLT-2476 Fixing username display in center channel
Diffstat (limited to 'webapp/components/channel_view.jsx')
-rw-r--r-- | webapp/components/channel_view.jsx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/webapp/components/channel_view.jsx b/webapp/components/channel_view.jsx index 54d796ac1..4cca5aa98 100644 --- a/webapp/components/channel_view.jsx +++ b/webapp/components/channel_view.jsx @@ -8,7 +8,6 @@ import PostsViewContainer from 'components/posts_view_container.jsx'; import CreatePost from 'components/create_post.jsx'; import ChannelStore from 'stores/channel_store.jsx'; -import UserStore from 'stores/user_store.jsx'; export default class ChannelView extends React.Component { constructor(props) { @@ -23,14 +22,12 @@ export default class ChannelView extends React.Component { getStateFromStores(props) { const channel = ChannelStore.getByName(props.params.channel); const channelId = channel ? channel.id : ''; - const profiles = JSON.parse(JSON.stringify(UserStore.getProfiles())); return { - channelId, - profiles + channelId }; } isStateValid() { - return this.state.channelId !== '' && this.state.profiles; + return this.state.channelId !== ''; } updateState() { this.setState(this.getStateFromStores(this.props)); @@ -44,13 +41,6 @@ export default class ChannelView extends React.Component { componentWillReceiveProps(nextProps) { this.setState(this.getStateFromStores(nextProps)); } - shouldComponentUpdate(nextProps, nextState) { - if (nextState.channelId !== this.state.channelId) { - return true; - } - - return false; - } render() { return ( <div @@ -60,7 +50,7 @@ export default class ChannelView extends React.Component { <ChannelHeader channelId={this.state.channelId} /> - <PostsViewContainer profiles={this.state.profiles}/> + <PostsViewContainer profiles={this.props.profiles}/> <div className='post-create__container' id='post-create' @@ -75,5 +65,6 @@ ChannelView.defaultProps = { }; ChannelView.propTypes = { - params: React.PropTypes.object.isRequired + params: React.PropTypes.object.isRequired, + profiles: React.PropTypes.object }; |