From 493722b8f20178cadce5a2af30680481394040dc Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 25 Feb 2016 12:59:24 -0500
Subject: Move post view container user store listener into center panel and
 pass profiles into post focus view

---
 web/react/components/center_panel.jsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'web/react/components/center_panel.jsx')

diff --git a/web/react/components/center_panel.jsx b/web/react/components/center_panel.jsx
index 97c615768..2422588cf 100644
--- a/web/react/components/center_panel.jsx
+++ b/web/react/components/center_panel.jsx
@@ -33,7 +33,8 @@ export default class CenterPanel extends React.Component {
         this.state = {
             showTutorialScreens: tutorialStep === TutorialSteps.INTRO_SCREENS,
             showPostFocus: ChannelStore.getPostMode() === ChannelStore.POST_MODE_FOCUS,
-            user: UserStore.getCurrentUser()
+            user: UserStore.getCurrentUser(),
+            profiles: JSON.parse(JSON.stringify(UserStore.getProfiles()))
         };
     }
     componentDidMount() {
@@ -54,7 +55,7 @@ export default class CenterPanel extends React.Component {
         this.setState({showPostFocus: ChannelStore.getPostMode() === ChannelStore.POST_MODE_FOCUS});
     }
     onUserChange() {
-        this.setState({user: UserStore.getCurrentUser()});
+        this.setState({user: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(UserStore.getProfiles()))});
     }
     render() {
         const channel = ChannelStore.getCurrent();
@@ -65,7 +66,7 @@ export default class CenterPanel extends React.Component {
             postsContainer = <TutorialIntroScreens/>;
             createPost = null;
         } else if (this.state.showPostFocus) {
-            postsContainer = <PostFocusView/>;
+            postsContainer = <PostFocusView profiles={this.state.profiles}/>;
 
             handleClick = function clickHandler(e) {
                 e.preventDefault();
@@ -87,7 +88,7 @@ export default class CenterPanel extends React.Component {
                 </div>
             );
         } else {
-            postsContainer = <PostsViewContainer/>;
+            postsContainer = <PostsViewContainer profiles={this.state.profiles}/>;
             createPost = (
                 <div
                     className='post-create__container'
-- 
cgit v1.2.3-1-g7c22

