From 54a064de98f43c55bed429867493e6f5c7e97379 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Thu, 31 Mar 2016 10:54:40 -0400
Subject: Fixing username display in center channel

---
 webapp/components/permalink_view.jsx | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

(limited to 'webapp/components/permalink_view.jsx')

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
 };
-- 
cgit v1.2.3-1-g7c22

