diff --git a/src/views/preview/comment/comment.jsx b/src/views/preview/comment/comment.jsx index ef23195ea..527d69c88 100644 --- a/src/views/preview/comment/comment.jsx +++ b/src/views/preview/comment/comment.jsx @@ -54,7 +54,11 @@ class Comment extends React.Component { } handleDelete () { - this.setState({deleting: true}); + if (this.props.canDeleteWithoutConfirm) { + this.props.onDelete(this.props.id); + } else { + this.setState({deleting: true}); + } } handleConfirmDelete () { @@ -267,6 +271,7 @@ Comment.propTypes = { username: PropTypes.string }), canDelete: PropTypes.bool, + canDeleteWithoutConfirm: PropTypes.bool, canReply: PropTypes.bool, canReport: PropTypes.bool, canRestore: PropTypes.bool, diff --git a/src/views/preview/comment/top-level-comment.jsx b/src/views/preview/comment/top-level-comment.jsx index ecc15208e..d74ef2df3 100644 --- a/src/views/preview/comment/top-level-comment.jsx +++ b/src/views/preview/comment/top-level-comment.jsx @@ -74,6 +74,7 @@ class TopLevelComment extends React.Component { const { author, canDelete, + canDeleteWithoutConfirm, canReply, canReport, canRestore, @@ -103,6 +104,7 @@ class TopLevelComment extends React.Component { content, datetimeCreated, canDelete, + canDeleteWithoutConfirm, canReply, canReport, canRestore, @@ -126,6 +128,7 @@ class TopLevelComment extends React.Component {