Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #3005: don't hide own comments even if flagged #3433

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/app/components/cards/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,17 @@ class CommentImpl extends React.Component {
if (content) {
const hide = hideSubtree(props.cont, props.content);
const gray = content.getIn(['stats', 'gray']);

const author = content.get('author');
const { username } = this.props;
const notOwn = username !== author;

if (hide) {
const { onHide } = this.props;
// console.log('Comment --> onHide')
if (onHide) onHide();
}
this.setState({ hide, hide_body: hide || gray });
this.setState({ hide, hide_body: notOwn && (hide || gray) });
}
}

Expand Down Expand Up @@ -471,6 +476,14 @@ class CommentImpl extends React.Component {
{tt('g.reveal_comment')}
</a>
)}
{!this.state.collapsed &&
!hide_body &&
(ignore || gray) && (
<span>
&nbsp; &middot; &nbsp;{' '}
{tt('g.will_be_hidden_due_to_low_rating')}
</span>
)}
</div>
<div className="Comment__body entry-content">
{showEdit ? renderedEditor : body}
Expand Down
1 change: 1 addition & 0 deletions src/app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
},
"reputation": "Reputation",
"reveal_comment": "Reveal Comment",
"will_be_hidden_due_to_low_rating": "Will be hidden due to low rating",
"request": "request",
"required": "Required",
"rewards": "Rewards",
Expand Down