summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-08-22 20:36:01 -0400
committerCorey Hulen <corey@hulen.com>2016-08-22 16:36:01 -0800
commit80d83ae77c85de5666dc88458e2888f66c49cc90 (patch)
tree3d5a5864662347529899a07e1009f70f5a326df9 /webapp
parentc3c62ad2ad018be6887149e92dd35bb527f55168 (diff)
downloadchat-80d83ae77c85de5666dc88458e2888f66c49cc90.tar.gz
chat-80d83ae77c85de5666dc88458e2888f66c49cc90.tar.bz2
chat-80d83ae77c85de5666dc88458e2888f66c49cc90.zip
Prevent flagging of deleted posts and don't show deleted posts in flagged post list (#3846)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/components/post_info.jsx35
-rw-r--r--webapp/components/rhs_comment.jsx35
2 files changed, 42 insertions, 28 deletions
diff --git a/webapp/components/post_view/components/post_info.jsx b/webapp/components/post_view/components/post_info.jsx
index d48d97ba1..e95afe3ed 100644
--- a/webapp/components/post_view/components/post_info.jsx
+++ b/webapp/components/post_view/components/post_info.jsx
@@ -336,6 +336,26 @@ export default class PostInfo extends React.Component {
flagFunc = this.flagPost;
}
+ let flagTrigger;
+ if (!Utils.isPostEphemeral(post)) {
+ flagTrigger = (
+ <OverlayTrigger
+ key={'flagtooltipkey' + flagVisible}
+ delayShow={Constants.OVERLAY_TIME_DELAY}
+ placement='top'
+ overlay={flagTooltip}
+ >
+ <a
+ href='#'
+ className={'flag-icon__container ' + flagVisible}
+ onClick={flagFunc}
+ >
+ {flag}
+ </a>
+ </OverlayTrigger>
+ );
+ }
+
return (
<ul className='post__header--info'>
<li className='col'>
@@ -345,20 +365,7 @@ export default class PostInfo extends React.Component {
compactDisplay={this.props.compactDisplay}
useMilitaryTime={this.props.useMilitaryTime}
/>
- <OverlayTrigger
- key={'flagtooltipkey' + flagVisible}
- delayShow={Constants.OVERLAY_TIME_DELAY}
- placement='top'
- overlay={flagTooltip}
- >
- <a
- href='#'
- className={'flag-icon__container ' + flagVisible}
- onClick={flagFunc}
- >
- {flag}
- </a>
- </OverlayTrigger>
+ {flagTrigger}
</li>
{options}
</ul>
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index 92182e27a..05df1ac5f 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -330,6 +330,26 @@ export default class RhsComment extends React.Component {
flagFunc = this.flagPost;
}
+ let flagTrigger;
+ if (!Utils.isPostEphemeral(post)) {
+ flagTrigger = (
+ <OverlayTrigger
+ key={'commentflagtooltipkey' + flagVisible}
+ delayShow={Constants.OVERLAY_TIME_DELAY}
+ placement='top'
+ overlay={flagTooltip}
+ >
+ <a
+ href='#'
+ className={'flag-icon__container ' + flagVisible}
+ onClick={flagFunc}
+ >
+ {flag}
+ </a>
+ </OverlayTrigger>
+ );
+ }
+
return (
<div className={'post post--thread ' + currentUserCss + ' ' + compactClass}>
<div className='post__content'>
@@ -352,20 +372,7 @@ export default class RhsComment extends React.Component {
minute='2-digit'
/>
</time>
- <OverlayTrigger
- key={'commentflagtooltipkey' + flagVisible}
- delayShow={Constants.OVERLAY_TIME_DELAY}
- placement='top'
- overlay={flagTooltip}
- >
- <a
- href='#'
- className={'flag-icon__container ' + flagVisible}
- onClick={flagFunc}
- >
- {flag}
- </a>
- </OverlayTrigger>
+ {flagTrigger}
</li>
<li className='col col__reply'>
{dropdown}