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/logged_in.jsx | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

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

diff --git a/webapp/components/logged_in.jsx b/webapp/components/logged_in.jsx
index f7a6be647..a4fd3a9ce 100644
--- a/webapp/components/logged_in.jsx
+++ b/webapp/components/logged_in.jsx
@@ -47,11 +47,12 @@ export default class LoggedIn extends React.Component {
         this.onUserChanged = this.onUserChanged.bind(this);
 
         this.state = {
-            user: null
+            user: null,
+            profiles: null
         };
     }
     isValidState() {
-        return this.state.user != null;
+        return this.state.user != null && this.state.profiles != null;
     }
     onUserChanged() {
         // Grab the current user
@@ -84,7 +85,13 @@ export default class LoggedIn extends React.Component {
             browserHistory.push(Utils.getTeamURLFromAddressBar() + '/tutorial');
         }
 
-        this.setState({user});
+        // Get profiles
+        const profiles = UserStore.getProfiles();
+
+        this.setState({
+            user,
+            profiles
+        });
     }
     componentWillMount() {
         // Emit view action
@@ -232,7 +239,10 @@ export default class LoggedIn extends React.Component {
                         </div>
                     </div>
                     <div className='row main'>
-                        {this.props.center}
+                        {React.cloneElement(this.props.center, {
+                            user: this.state.user,
+                            profiles: this.state.profiles
+                        })}
                     </div>
                 </div>
             );
-- 
cgit v1.2.3-1-g7c22

