summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_info.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-10-06 11:52:55 -0400
committerJoramWilander <jwawilander@gmail.com>2015-10-06 11:52:55 -0400
commit384b9d592e73ae423cb0d2d2ae11dbc4b60da17f (patch)
tree70e0b882a2993d8b1b7ccaae1e8a833224a78bf6 /web/react/components/post_info.jsx
parent429cc6e0e6ac0e34d0216745bec0c4eb9684108c (diff)
downloadchat-384b9d592e73ae423cb0d2d2ae11dbc4b60da17f.tar.gz
chat-384b9d592e73ae423cb0d2d2ae11dbc4b60da17f.tar.bz2
chat-384b9d592e73ae423cb0d2d2ae11dbc4b60da17f.zip
Allow team admin to delete comments.
Diffstat (limited to 'web/react/components/post_info.jsx')
-rw-r--r--web/react/components/post_info.jsx14
1 files changed, 4 insertions, 10 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index dba75ac5f..c1e8979a4 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -13,12 +13,6 @@ export default class PostInfo extends React.Component {
super(props);
this.state = {};
}
- shouldShowComment(state, type, isOwner) {
- if (state === Constants.POST_FAILED || state === Constants.POST_LOADING) {
- return false;
- }
- return isOwner || (this.props.allowReply === 'true' && type !== 'Comment');
- }
createDropdown() {
var post = this.props.post;
var isOwner = UserStore.getCurrentId() === post.user_id;
@@ -33,10 +27,6 @@ export default class PostInfo extends React.Component {
type = 'Comment';
}
- if (!this.shouldShowComment(post.state, type, isOwner)) {
- return '';
- }
-
var dropdownContents = [];
var dataComments = 0;
if (type === 'Post') {
@@ -106,6 +96,10 @@ export default class PostInfo extends React.Component {
);
}
+ if (dropdownContents.length === 0) {
+ return '';
+ }
+
return (
<div>
<a