summaryrefslogtreecommitdiffstats
path: root/webapp/components/rhs_root_post.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-03-22 08:09:29 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-03-22 08:09:29 -0400
commit1b6b70c805f14dc690c6ecda8abb1a2bc8386b60 (patch)
tree5fe2eba08a7bd46059f2092cd31da2033600490c /webapp/components/rhs_root_post.jsx
parentaac95a7e2a8db8e008ef5fa4b58e3a210db50c12 (diff)
parent21bbd6bae56b23ec25167520e42a8d771e047092 (diff)
downloadchat-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_root_post.jsx')
-rw-r--r--webapp/components/rhs_root_post.jsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx
index a2c7ee7f8..1aa4a555f 100644
--- a/webapp/components/rhs_root_post.jsx
+++ b/webapp/components/rhs_root_post.jsx
@@ -55,8 +55,8 @@ export default class RhsRootPost extends React.Component {
render() {
const post = this.props.post;
const user = this.props.user;
- var isOwner = user.id === post.user_id;
- var isAdmin = Utils.isAdmin(user.roles);
+ var isOwner = this.props.currentUser.id === post.user_id;
+ var isAdmin = Utils.isAdmin(this.props.currentUser.roles);
var timestamp = UserStore.getProfile(post.user_id).update_at;
var channel = ChannelStore.get(post.channel_id);
@@ -286,5 +286,6 @@ RhsRootPost.defaultProps = {
RhsRootPost.propTypes = {
post: React.PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired,
+ currentUser: React.PropTypes.object.isRequired,
commentCount: React.PropTypes.number
};