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_comment.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_comment.jsx')
-rw-r--r-- | webapp/components/rhs_comment.jsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index 29986d415..de99eb37d 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -5,7 +5,6 @@ import ReactDOM from 'react-dom'; import PostStore from 'stores/post_store.jsx'; import ChannelStore from 'stores/channel_store.jsx'; import UserProfile from './user_profile.jsx'; -import UserStore from 'stores/user_store.jsx'; import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; @@ -97,8 +96,8 @@ class RhsComment extends React.Component { return ''; } - var isOwner = UserStore.getCurrentId() === post.user_id; - var isAdmin = Utils.isAdmin(UserStore.getCurrentUser().roles); + const isOwner = this.props.currentUser.id === post.user_id; + const isAdmin = Utils.isAdmin(this.props.currentUser.roles); var dropdownContents = []; @@ -193,11 +192,11 @@ class RhsComment extends React.Component { var post = this.props.post; var currentUserCss = ''; - if (UserStore.getCurrentId() === post.user_id) { + if (this.props.currentUser === post.user_id) { currentUserCss = 'current--user'; } - var timestamp = UserStore.getCurrentUser().update_at; + var timestamp = this.props.currentUser.update_at; let loading; let postClass = ''; @@ -305,7 +304,8 @@ RhsComment.defaultProps = { RhsComment.propTypes = { intl: intlShape.isRequired, post: React.PropTypes.object, - user: React.PropTypes.object + user: React.PropTypes.object.isRequired, + currentUser: React.PropTypes.object.isRequired }; export default injectIntl(RhsComment); |