summaryrefslogtreecommitdiffstats
path: root/webapp/components/channel_view.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-31 10:54:40 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-31 10:58:12 -0400
commit54a064de98f43c55bed429867493e6f5c7e97379 (patch)
treeb4991a5ce3856a804ccf870bbdef41f69649e779 /webapp/components/channel_view.jsx
parentc8b2af62468c5d0906ba08d3e2a378681f99eb08 (diff)
downloadchat-54a064de98f43c55bed429867493e6f5c7e97379.tar.gz
chat-54a064de98f43c55bed429867493e6f5c7e97379.tar.bz2
chat-54a064de98f43c55bed429867493e6f5c7e97379.zip
Fixing username display in center channel
Diffstat (limited to 'webapp/components/channel_view.jsx')
-rw-r--r--webapp/components/channel_view.jsx19
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
};