summaryrefslogtreecommitdiffstats
path: root/webapp/components/permalink_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/permalink_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/permalink_view.jsx')
-rw-r--r--webapp/components/permalink_view.jsx25
1 files changed, 4 insertions, 21 deletions
diff --git a/webapp/components/permalink_view.jsx b/webapp/components/permalink_view.jsx
index 2ebe52356..2c32d643d 100644
--- a/webapp/components/permalink_view.jsx
+++ b/webapp/components/permalink_view.jsx
@@ -7,7 +7,6 @@ import ChannelHeader from 'components/channel_header.jsx';
import PostFocusView from 'components/post_focus_view.jsx';
import ChannelStore from 'stores/channel_store.jsx';
-import UserStore from 'stores/user_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import {Link} from 'react-router';
@@ -30,17 +29,15 @@ export default class PermalinkView extends React.Component {
const channelName = channel ? channel.name : '';
const team = TeamStore.getCurrent();
const teamName = team ? team.name : '';
- const profiles = JSON.parse(JSON.stringify(UserStore.getProfiles()));
return {
channelId,
channelName,
- profiles,
teamName,
postId
};
}
isStateValid() {
- return this.state.channelId !== '' && this.state.profiles && this.state.teamName;
+ return this.state.channelId !== '' && this.state.teamName;
}
updateState() {
this.setState(this.getStateFromStores(this.props));
@@ -56,21 +53,6 @@ export default class PermalinkView extends React.Component {
componentWillReceiveProps(nextProps) {
this.setState(this.getStateFromStores(nextProps));
}
- shouldComponentUpdate(nextProps, nextState) {
- if (nextState.postId !== this.state.postId) {
- return true;
- }
-
- if (nextState.channelId !== this.state.channelId) {
- return true;
- }
-
- if (nextState.teamName !== this.state.teamName) {
- return true;
- }
-
- return false;
- }
render() {
if (!this.isStateValid()) {
return null;
@@ -83,7 +65,7 @@ export default class PermalinkView extends React.Component {
<ChannelHeader
channelId={this.state.channelId}
/>
- <PostFocusView profiles={this.state.profiles}/>
+ <PostFocusView profiles={this.props.profiles}/>
<div
id='archive-link-home'
>
@@ -106,5 +88,6 @@ PermalinkView.defaultProps = {
};
PermalinkView.propTypes = {
- params: React.PropTypes.object.isRequired
+ params: React.PropTypes.object.isRequired,
+ profiles: React.PropTypes.object
};