diff --git a/webapp/components/post_view/components/post.jsx b/webapp/components/post_view/components/post.jsx index e9019bf38b..7aa0c028e0 100644 --- a/webapp/components/post_view/components/post.jsx +++ b/webapp/components/post_view/components/post.jsx @@ -236,7 +236,6 @@ export default class Post extends React.Component { post={post} sameRoot={this.props.sameRoot} commentCount={commentCount} - isCommentMention={this.props.isCommentMention} handleCommentClick={this.handleCommentClick} handleDropdownOpened={this.handleDropdownOpened} isLastComment={this.props.isLastComment} @@ -255,6 +254,7 @@ export default class Post extends React.Component { handleCommentClick={this.handleCommentClick} compactDisplay={this.props.compactDisplay} previewCollapsed={this.props.previewCollapsed} + isCommentMention={this.props.isCommentMention} /> diff --git a/webapp/components/post_view/components/post_body.jsx b/webapp/components/post_view/components/post_body.jsx index 8c3b3009fc..3295f5bacd 100644 --- a/webapp/components/post_view/components/post_body.jsx +++ b/webapp/components/post_view/components/post_body.jsx @@ -23,6 +23,10 @@ export default class PostBody extends React.Component { this.removePost = this.removePost.bind(this); } shouldComponentUpdate(nextProps) { + if (nextProps.isCommentMention !== this.props.isCommentMention) { + return true; + } + if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) { return true; } @@ -190,10 +194,15 @@ export default class PostBody extends React.Component { ); } + let mentionHighlightClass = ''; + if (this.props.isCommentMention) { + mentionHighlightClass = 'mention-comment'; + } + return (