diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-03-22 08:09:29 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-03-22 08:09:29 -0400 |
commit | 1b6b70c805f14dc690c6ecda8abb1a2bc8386b60 (patch) | |
tree | 5fe2eba08a7bd46059f2092cd31da2033600490c /webapp/components/rhs_thread.jsx | |
parent | aac95a7e2a8db8e008ef5fa4b58e3a210db50c12 (diff) | |
parent | 21bbd6bae56b23ec25167520e42a8d771e047092 (diff) | |
download | chat-1b6b70c805f14dc690c6ecda8abb1a2bc8386b60.tar.gz chat-1b6b70c805f14dc690c6ecda8abb1a2bc8386b60.tar.bz2 chat-1b6b70c805f14dc690c6ecda8abb1a2bc8386b60.zip |
Merge pull request #2495 from hmhealey/plt2317a
PLT-2317 Changed RhsRootPost and RhsComment to receive current user through props
Diffstat (limited to 'webapp/components/rhs_thread.jsx')
-rw-r--r-- | webapp/components/rhs_thread.jsx | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx index cc900f8e7..2760765eb 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,26 @@ 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} + currentUser={this.props.currentUser} + /> + ); + })} </div> <div className='post-create__container'> <CreateComment @@ -221,5 +223,6 @@ RhsThread.defaultProps = { RhsThread.propTypes = { fromSearch: React.PropTypes.string, - isMentionSearch: React.PropTypes.bool + isMentionSearch: React.PropTypes.bool, + currentUser: React.PropTypes.object.isRequired }; |