+ handlePurgePersonShow(i: CommentNode) {
+ i.state.showPurgeDialog = true;
+ i.state.purgeType = PurgeType.Person;
+ i.state.showRemoveDialog = false;
+ i.setState(i.state);
+ }
+
+ handlePurgeCommentShow(i: CommentNode) {
+ i.state.showPurgeDialog = true;
+ i.state.purgeType = PurgeType.Comment;
+ i.state.showRemoveDialog = false;
+ i.setState(i.state);
+ }
+
+ handlePurgeReasonChange(i: CommentNode, event: any) {
+ i.state.purgeReason = Some(event.target.value);
+ i.setState(i.state);
+ }
+
+ handlePurgeSubmit(i: CommentNode, event: any) {
+ event.preventDefault();
+
+ if (i.state.purgeType == PurgeType.Person) {
+ let form = new PurgePerson({
+ person_id: i.props.node.comment_view.creator.id,
+ reason: i.state.purgeReason,
+ auth: auth().unwrap(),
+ });
+ WebSocketService.Instance.send(wsClient.purgePerson(form));
+ } else if (i.state.purgeType == PurgeType.Comment) {
+ let form = new PurgeComment({
+ comment_id: i.props.node.comment_view.comment.id,
+ reason: i.state.purgeReason,
+ auth: auth().unwrap(),
+ });
+ WebSocketService.Instance.send(wsClient.purgeComment(form));
+ }
+
+ i.state.purgeLoading = true;
+ i.setState(i.state);
+ }
+