From fefacf039fff499a471c6a4f74416a116b9dfbc5 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Fri, 8 Sep 2017 13:25:23 -0300 Subject: [PATCH] Featured comments should have ACCEPTED status --- client/coral-embed-stream/src/components/Comment.js | 2 -- plugins/talk-plugin-featured-comments/client/index.js | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 4f95b06fd..68eaf50cc 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -342,8 +342,6 @@ export default class Comment extends React.Component { commentClassNames = [] } = this.props; - console.log('STATUS', comment.status); - if (this.commentIsRejected(comment)) { return ; } diff --git a/plugins/talk-plugin-featured-comments/client/index.js b/plugins/talk-plugin-featured-comments/client/index.js index 1fa78ba24..e451ad830 100644 --- a/plugins/talk-plugin-featured-comments/client/index.js +++ b/plugins/talk-plugin-featured-comments/client/index.js @@ -58,6 +58,17 @@ export default { const updated = update(previous, { asset: { + comments: { + nodes: { + $apply: (nodes) => nodes.map((node) => { + if (node.id === variables.id) { + node.status = 'ACCEPTED'; + } + + return node; + }) + } + }, featuredComments: { nodes: { $apply: (nodes) => prependNewNodes(nodes, [comment]),