From: Dessalines Date: Fri, 29 Mar 2019 06:03:17 +0000 (-0700) Subject: Adding delete comment X-Git-Url: http://these/git/readmes/static/%7B%60https:/%7B%60%24%7BrepoUrl%7D?a=commitdiff_plain;h=743390113a7f2f95209acabbdc6c9aeb92b08008;p=lemmy.git Adding delete comment - Fixes #9 --- diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index c5c8a53f..1cd61ea3 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -267,6 +267,11 @@ export class CommentNode extends Component { edit } + {this.myComment && +
  • + delete +
  • + }
  • link
  • @@ -294,6 +299,17 @@ export class CommentNode extends Component { i.setState(i.state); } + handleDeleteClick(i: CommentNode, event) { + let deleteForm: CommentFormI = { + content: "*deleted*", + edit_id: i.props.node.comment.id, + post_id: i.props.node.comment.post_id, + parent_id: i.props.node.comment.parent_id, + auth: null + }; + WebSocketService.Instance.editComment(deleteForm); + } + handleReplyCancel(): any { this.state.showReply = false; this.state.showEdit = false;