From bb16a71d6eb77c8035c7b1672aa1d5bc8ed7045e Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Mon, 21 Mar 2016 10:30:17 -0400
Subject: Passed currentUser into RhsRootPost

---
 webapp/components/rhs_thread.jsx | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

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

diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx
index cc900f8e7..ca950e2dc 100644
--- a/webapp/components/rhs_thread.jsx
+++ b/webapp/components/rhs_thread.jsx
@@ -130,7 +130,7 @@ export default class RhsThread extends React.Component {
         }
 
         // sort failed posts to bottom, followed by pending, and then regular posts
-        postsArray.sort(function postSort(a, b) {
+        postsArray.sort((a, b) => {
             if ((a.state === Constants.POST_LOADING || a.state === Constants.POST_FAILED) && (b.state !== Constants.POST_LOADING && b.state !== Constants.POST_FAILED)) {
                 return 1;
             }
@@ -182,24 +182,25 @@ export default class RhsThread extends React.Component {
                             post={selected}
                             commentCount={postsArray.length}
                             user={profile}
+                            currentUser={this.props.currentUser}
                         />
                         <div className='post-right-comments-container'>
-                        {postsArray.map(function mapPosts(comPost) {
-                            let p;
-                            if (UserStore.getCurrentId() === comPost.user_id) {
-                                p = UserStore.getCurrentUser();
-                            } else {
-                                p = profiles[comPost.user_id];
-                            }
-                            return (
-                                <Comment
-                                    ref={comPost.id}
-                                    key={comPost.id + 'commentKey'}
-                                    post={comPost}
-                                    user={p}
-                                />
-                            );
-                        })}
+                            {postsArray.map((comPost) => {
+                                let p;
+                                if (UserStore.getCurrentId() === comPost.user_id) {
+                                    p = UserStore.getCurrentUser();
+                                } else {
+                                    p = profiles[comPost.user_id];
+                                }
+                                return (
+                                    <Comment
+                                        ref={comPost.id}
+                                        key={comPost.id + 'commentKey'}
+                                        post={comPost}
+                                        user={p}
+                                    />
+                                );
+                            })}
                         </div>
                         <div className='post-create__container'>
                             <CreateComment
@@ -221,5 +222,6 @@ RhsThread.defaultProps = {
 
 RhsThread.propTypes = {
     fromSearch: React.PropTypes.string,
-    isMentionSearch: React.PropTypes.bool
+    isMentionSearch: React.PropTypes.bool,
+    currentUser: React.PropTypes.object.isRequired
 };
-- 
cgit v1.2.3-1-g7c22


From 21bbd6bae56b23ec25167520e42a8d771e047092 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Mon, 21 Mar 2016 13:11:03 -0400
Subject: Changed RhsComment to receive the current user through props

---
 webapp/components/rhs_thread.jsx | 1 +
 1 file changed, 1 insertion(+)

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

diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx
index ca950e2dc..2760765eb 100644
--- a/webapp/components/rhs_thread.jsx
+++ b/webapp/components/rhs_thread.jsx
@@ -198,6 +198,7 @@ export default class RhsThread extends React.Component {
                                         key={comPost.id + 'commentKey'}
                                         post={comPost}
                                         user={p}
+                                        currentUser={this.props.currentUser}
                                     />
                                 );
                             })}
-- 
cgit v1.2.3-1-g7c22

