diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js index 6e4c4b525..1310358fe 100644 --- a/client/coral-embed-stream/src/Comment.js +++ b/client/coral-embed-stream/src/Comment.js @@ -135,7 +135,11 @@ class Comment extends React.Component { { this.state.replyBoxVisible ? { + console.log('replyPostedHandler'); + this.setState({replyBoxVisible: false}); + refetch(); + }} parentId={parentId || comment.id} addNotification={addNotification} authorId={currentUser.id} diff --git a/client/coral-framework/modules/notification/Notification.js b/client/coral-framework/modules/notification/Notification.js index 43ef921d8..2a5e1d693 100644 --- a/client/coral-framework/modules/notification/Notification.js +++ b/client/coral-framework/modules/notification/Notification.js @@ -1,7 +1,6 @@ import React from 'react'; const Notification = (props) => { - console.log(props); if (props.notification.text) { setTimeout(() => { props.clearNotification(); diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index 9251d16dc..409a0ea4d 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -11,7 +11,7 @@ class CommentBox extends Component { // updateItem: PropTypes.func, // comments: PropTypes.array, - refetch: PropTypes.func.isRequired, + replyPostedHandler: PropTypes.func, postItem: PropTypes.func.isRequired, assetId: PropTypes.string.isRequired, parentId: PropTypes.string, @@ -32,11 +32,11 @@ class CommentBox extends Component { // child_id, // updateItem, // appendItemArray, + replyPostedHandler, postItem, assetId, parentId, addNotification, - refetch, authorId } = this.props; @@ -78,7 +78,10 @@ class CommentBox extends Component { // appendItemArray(parent_id || id, related, commentId, !parent_id, parent_type); addNotification('success', 'Your comment has been posted.'); } - refetch(); + + if (replyPostedHandler) { + replyPostedHandler(); + } }) .catch((err) => console.error(err)); this.setState({body: ''}); diff --git a/client/coral-plugin-replies/ReplyBox.js b/client/coral-plugin-replies/ReplyBox.js index 81e2035ea..ac1a702f8 100644 --- a/client/coral-plugin-replies/ReplyBox.js +++ b/client/coral-plugin-replies/ReplyBox.js @@ -3,10 +3,10 @@ import CommentBox from '../coral-plugin-commentbox/CommentBox'; const name = 'coral-plugin-replies'; -const ReplyBox = ({styles, postItem, assetId, authorId, addNotification, parentId, refetch}) => ( +const ReplyBox = ({styles, postItem, assetId, authorId, addNotification, parentId, replyPostedHandler}) => (