u.id === comment.user.id)
+ );
+ }
+
hasIgnoredReplies() {
return this.props.comment.replies &&
- this.props.comment.replies.nodes.some((reply) => this.props.commentIsIgnored(reply));
+ this.props.comment.replies.nodes.some((reply) => this.commentIsIgnored(reply));
}
loadNewReplies = () => {
@@ -327,12 +333,15 @@ export default class Comment extends React.Component {
charCountEnable,
showSignInDialog,
liveUpdates,
- commentIsIgnored,
animateEnter,
emit,
commentClassNames = []
} = this.props;
+ if (this.commentIsIgnored(comment)) {
+ return ;
+ }
+
const view = this.getVisibileReplies();
// Inactive comments can be viewed by moderators and admins (e.g. using permalinks).
@@ -566,9 +575,8 @@ export default class Comment extends React.Component {
{view.map((reply) => {
- return commentIsIgnored(reply)
- ?
- : ;
+ />
+ );
})}
diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js
index 575c1fd00..89e7b13ae 100644
--- a/client/coral-embed-stream/src/components/Stream.js
+++ b/client/coral-embed-stream/src/components/Stream.js
@@ -40,15 +40,6 @@ class Stream extends React.Component {
}
}
- commentIsIgnored = (comment) => {
- const me = this.props.root.me;
- return (
- me &&
- me.ignoredUsers &&
- me.ignoredUsers.find((u) => u.id === comment.user.id)
- );
- };
-
renderHighlightedComment() {
const {
data,
@@ -104,7 +95,6 @@ class Stream extends React.Component {
deleteAction={deleteAction}
showSignInDialog={showSignInDialog}
key={topLevelComment.id}
- commentIsIgnored={this.commentIsIgnored}
comment={topLevelComment}
charCountEnable={asset.settings.charCountEnable}
maxCharCount={asset.settings.charCount}
@@ -193,7 +183,6 @@ class Stream extends React.Component {
loadNewReplies={loadNewReplies}
deleteAction={deleteAction}
showSignInDialog={showSignInDialog}
- commentIsIgnored={this.commentIsIgnored}
charCountEnable={asset.settings.charCountEnable}
maxCharCount={asset.settings.charCount}
editComment={editComment}
diff --git a/client/coral-embed-stream/src/containers/Comment.js b/client/coral-embed-stream/src/containers/Comment.js
index a4bfbc0eb..f24dc8b01 100644
--- a/client/coral-embed-stream/src/containers/Comment.js
+++ b/client/coral-embed-stream/src/containers/Comment.js
@@ -93,6 +93,11 @@ const withCommentFragments = withFragments({
fragment CoralEmbedStream_Comment_root on RootQuery {
__typename
${getSlotFragmentSpreads(slots, 'root')}
+ me {
+ ignoredUsers {
+ id
+ }
+ }
}
`,
asset: gql`