]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/comment/comment-node.tsx
Use http client (#1081)
[lemmy-ui.git] / src / shared / components / comment / comment-node.tsx
index 4555ff58a7b2b81eb683144ab78d0287d405bb0e..8559f38baa1355d0809ed3766d34f328a35dc639 100644 (file)
@@ -1,6 +1,5 @@
-import { Left, None, Option, Some } from "@sniptt/monads";
 import classNames from "classnames";
-import { Component, linkEvent } from "inferno";
+import { Component, InfernoNode, linkEvent } from "inferno";
 import { Link } from "inferno-router";
 import {
   AddAdmin,
@@ -8,49 +7,57 @@ import {
   BanFromCommunity,
   BanPerson,
   BlockPerson,
-  CommentNode as CommentNodeI,
+  CommentId,
   CommentReplyView,
   CommentView,
   CommunityModeratorView,
+  CreateComment,
   CreateCommentLike,
   CreateCommentReport,
   DeleteComment,
+  DistinguishComment,
   EditComment,
   GetComments,
   Language,
-  ListingType,
   MarkCommentReplyAsRead,
   MarkPersonMentionAsRead,
   PersonMentionView,
-  PersonViewSafe,
+  PersonView,
   PurgeComment,
   PurgePerson,
   RemoveComment,
   SaveComment,
-  toUndefined,
   TransferCommunity,
 } from "lemmy-js-client";
 import moment from "moment";
 import { i18n } from "../../i18next";
-import { BanType, CommentViewType, PurgeType } from "../../interfaces";
-import { UserService, WebSocketService } from "../../services";
+import {
+  BanType,
+  CommentNodeI,
+  CommentViewType,
+  PurgeType,
+  VoteType,
+} from "../../interfaces";
+import { UserService } from "../../services";
 import {
   amCommunityCreator,
-  auth,
   canAdmin,
   canMod,
   colorList,
   commentTreeMaxDepth,
   futureDaysToUnixTime,
+  getCommentParentId,
   isAdmin,
   isBanned,
   isMod,
   mdToHtml,
   mdToHtmlNoImages,
+  myAuth,
+  myAuthRequired,
+  newVote,
   numToSI,
   setupTippy,
   showScores,
-  wsClient,
 } from "../../utils";
 import { Icon, PurgeWarning, Spinner } from "../common/icon";
 import { MomentTime } from "../common/moment-time";
@@ -63,16 +70,15 @@ interface CommentNodeState {
   showReply: boolean;
   showEdit: boolean;
   showRemoveDialog: boolean;
-  removeReason: Option<string>;
+  removeReason?: string;
   showBanDialog: boolean;
   removeData: boolean;
-  banReason: Option<string>;
-  banExpireDays: Option<number>;
+  banReason?: string;
+  banExpireDays?: number;
   banType: BanType;
   showPurgeDialog: boolean;
-  purgeReason: Option<string>;
+  purgeReason?: string;
   purgeType: PurgeType;
-  purgeLoading: boolean;
   showConfirmTransferSite: boolean;
   showConfirmTransferCommunity: boolean;
   showConfirmAppointAsMod: boolean;
@@ -81,19 +87,29 @@ interface CommentNodeState {
   viewSource: boolean;
   showAdvanced: boolean;
   showReportDialog: boolean;
-  reportReason: string;
-  my_vote: Option<number>;
-  score: number;
-  upvotes: number;
-  downvotes: number;
-  readLoading: boolean;
+  reportReason?: string;
+  createOrEditCommentLoading: boolean;
+  upvoteLoading: boolean;
+  downvoteLoading: boolean;
   saveLoading: boolean;
+  readLoading: boolean;
+  blockPersonLoading: boolean;
+  deleteLoading: boolean;
+  removeLoading: boolean;
+  distinguishLoading: boolean;
+  banLoading: boolean;
+  addModLoading: boolean;
+  addAdminLoading: boolean;
+  transferCommunityLoading: boolean;
+  fetchChildrenLoading: boolean;
+  reportLoading: boolean;
+  purgeLoading: boolean;
 }
 
 interface CommentNodeProps {
   node: CommentNodeI;
-  moderators: Option<CommunityModeratorView[]>;
-  admins: Option<PersonViewSafe[]>;
+  moderators?: CommunityModeratorView[];
+  admins?: PersonView[];
   noBorder?: boolean;
   noIndent?: boolean;
   viewOnly?: boolean;
@@ -101,26 +117,42 @@ interface CommentNodeProps {
   markable?: boolean;
   showContext?: boolean;
   showCommunity?: boolean;
-  enableDownvotes: boolean;
+  enableDownvotes?: boolean;
   viewType: CommentViewType;
   allLanguages: Language[];
+  siteLanguages: number[];
   hideImages?: boolean;
+  finished: Map<CommentId, boolean | undefined>;
+  onSaveComment(form: SaveComment): void;
+  onCommentReplyRead(form: MarkCommentReplyAsRead): void;
+  onPersonMentionRead(form: MarkPersonMentionAsRead): void;
+  onCreateComment(form: EditComment | CreateComment): void;
+  onEditComment(form: EditComment | CreateComment): void;
+  onCommentVote(form: CreateCommentLike): void;
+  onBlockPerson(form: BlockPerson): void;
+  onDeleteComment(form: DeleteComment): void;
+  onRemoveComment(form: RemoveComment): void;
+  onDistinguishComment(form: DistinguishComment): void;
+  onAddModToCommunity(form: AddModToCommunity): void;
+  onAddAdmin(form: AddAdmin): void;
+  onBanPersonFromCommunity(form: BanFromCommunity): void;
+  onBanPerson(form: BanPerson): void;
+  onTransferCommunity(form: TransferCommunity): void;
+  onFetchChildren?(form: GetComments): void;
+  onCommentReport(form: CreateCommentReport): void;
+  onPurgePerson(form: PurgePerson): void;
+  onPurgeComment(form: PurgeComment): void;
 }
 
 export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
-  private emptyState: CommentNodeState = {
+  state: CommentNodeState = {
     showReply: false,
     showEdit: false,
     showRemoveDialog: false,
-    removeReason: None,
     showBanDialog: false,
     removeData: false,
-    banReason: None,
-    banExpireDays: None,
     banType: BanType.Community,
     showPurgeDialog: false,
-    purgeLoading: false,
-    purgeReason: None,
     purgeType: PurgeType.Person,
     collapsed: false,
     viewSource: false,
@@ -130,82 +162,122 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     showConfirmAppointAsMod: false,
     showConfirmAppointAsAdmin: false,
     showReportDialog: false,
-    reportReason: null,
-    my_vote: this.props.node.comment_view.my_vote,
-    score: this.props.node.comment_view.counts.score,
-    upvotes: this.props.node.comment_view.counts.upvotes,
-    downvotes: this.props.node.comment_view.counts.downvotes,
-    readLoading: false,
+    createOrEditCommentLoading: false,
+    upvoteLoading: false,
+    downvoteLoading: false,
     saveLoading: false,
+    readLoading: false,
+    blockPersonLoading: false,
+    deleteLoading: false,
+    removeLoading: false,
+    distinguishLoading: false,
+    banLoading: false,
+    addModLoading: false,
+    addAdminLoading: false,
+    transferCommunityLoading: false,
+    fetchChildrenLoading: false,
+    reportLoading: false,
+    purgeLoading: false,
   };
 
   constructor(props: any, context: any) {
     super(props, context);
 
-    this.state = this.emptyState;
     this.handleReplyCancel = this.handleReplyCancel.bind(this);
-    this.handleCommentUpvote = this.handleCommentUpvote.bind(this);
-    this.handleCommentDownvote = this.handleCommentDownvote.bind(this);
   }
 
-  // TODO see if there's a better way to do this, and all willReceiveProps
-  componentWillReceiveProps(nextProps: CommentNodeProps) {
-    let cv = nextProps.node.comment_view;
-    this.setState({
-      my_vote: cv.my_vote,
-      upvotes: cv.counts.upvotes,
-      downvotes: cv.counts.downvotes,
-      score: cv.counts.score,
-      readLoading: false,
-      saveLoading: false,
-    });
+  get commentView(): CommentView {
+    return this.props.node.comment_view;
   }
 
-  render() {
-    let node = this.props.node;
-    let cv = this.props.node.comment_view;
-
-    let purgeTypeText: string;
-    if (this.state.purgeType == PurgeType.Comment) {
-      purgeTypeText = i18n.t("purge_comment");
-    } else if (this.state.purgeType == PurgeType.Person) {
-      purgeTypeText = `${i18n.t("purge")} ${cv.creator.name}`;
+  get commentId(): CommentId {
+    return this.commentView.comment.id;
+  }
+
+  componentWillReceiveProps(
+    nextProps: Readonly<{ children?: InfernoNode } & CommentNodeProps>
+  ): void {
+    if (this.props != nextProps) {
+      this.setState({
+        showReply: false,
+        showEdit: false,
+        showRemoveDialog: false,
+        showBanDialog: false,
+        removeData: false,
+        banType: BanType.Community,
+        showPurgeDialog: false,
+        purgeType: PurgeType.Person,
+        collapsed: false,
+        viewSource: false,
+        showAdvanced: false,
+        showConfirmTransferSite: false,
+        showConfirmTransferCommunity: false,
+        showConfirmAppointAsMod: false,
+        showConfirmAppointAsAdmin: false,
+        showReportDialog: false,
+        createOrEditCommentLoading: false,
+        upvoteLoading: false,
+        downvoteLoading: false,
+        saveLoading: false,
+        readLoading: false,
+        blockPersonLoading: false,
+        deleteLoading: false,
+        removeLoading: false,
+        distinguishLoading: false,
+        banLoading: false,
+        addModLoading: false,
+        addAdminLoading: false,
+        transferCommunityLoading: false,
+        fetchChildrenLoading: false,
+        reportLoading: false,
+        purgeLoading: false,
+      });
     }
+  }
+
+  render() {
+    const node = this.props.node;
+    const cv = this.commentView;
+
+    const purgeTypeText =
+      this.state.purgeType == PurgeType.Comment
+        ? i18n.t("purge_comment")
+        : `${i18n.t("purge")} ${cv.creator.name}`;
 
-    let canMod_ = canMod(
+    const canMod_ = canMod(
+      cv.creator.id,
       this.props.moderators,
-      this.props.admins,
-      cv.creator.id
+      this.props.admins
     );
-    let canModOnSelf = canMod(
+    const canModOnSelf = canMod(
+      cv.creator.id,
       this.props.moderators,
       this.props.admins,
-      cv.creator.id,
       UserService.Instance.myUserInfo,
       true
     );
-    let canAdmin_ = canAdmin(this.props.admins, cv.creator.id);
-    let canAdminOnSelf = canAdmin(
-      this.props.admins,
+    const canAdmin_ = canAdmin(cv.creator.id, this.props.admins);
+    const canAdminOnSelf = canAdmin(
       cv.creator.id,
+      this.props.admins,
       UserService.Instance.myUserInfo,
       true
     );
-    let isMod_ = isMod(this.props.moderators, cv.creator.id);
-    let isAdmin_ = isAdmin(this.props.admins, cv.creator.id);
-    let amCommunityCreator_ = amCommunityCreator(
-      this.props.moderators,
-      cv.creator.id
+    const isMod_ = isMod(cv.creator.id, this.props.moderators);
+    const isAdmin_ = isAdmin(cv.creator.id, this.props.admins);
+    const amCommunityCreator_ = amCommunityCreator(
+      cv.creator.id,
+      this.props.moderators
     );
 
-    let borderColor = this.props.node.depth
+    const borderColor = this.props.node.depth
       ? colorList[(this.props.node.depth - 1) % colorList.length]
       : colorList[0];
-    let moreRepliesBorderColor = this.props.node.depth
+    const moreRepliesBorderColor = this.props.node.depth
       ? colorList[this.props.node.depth % colorList.length]
       : colorList[0];
 
-    let showMoreChildren =
+    const showMoreChildren =
       this.props.viewType == CommentViewType.Tree &&
       !this.state.collapsed &&
       node.children.length == 0 &&
@@ -221,53 +293,57 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
           id={`comment-${cv.comment.id}`}
           className={classNames(`details comment-node py-2`, {
             "border-top border-light": !this.props.noBorder,
-            mark:
-              this.isCommentNew ||
-              this.props.node.comment_view.comment.distinguished,
+            mark: this.isCommentNew || this.commentView.comment.distinguished,
           })}
           style={
-            !this.props.noIndent &&
-            this.props.node.depth &&
-            `border-left: 2px ${borderColor} solid !important`
+            !this.props.noIndent && this.props.node.depth
+              ? `border-left: 2px ${borderColor} solid !important`
+              : ""
           }
         >
           <div
-            className={`${
-              !this.props.noIndent && this.props.node.depth && "ml-2"
-            }`}
+            className={classNames({
+              "ml-2": !this.props.noIndent && this.props.node.depth,
+            })}
           >
             <div className="d-flex flex-wrap align-items-center text-muted small">
+              <button
+                className="btn btn-sm text-muted mr-2"
+                onClick={linkEvent(this, this.handleCommentCollapse)}
+                aria-label={this.expandText}
+                data-tippy-content={this.expandText}
+              >
+                <Icon
+                  icon={`${this.state.collapsed ? "plus" : "minus"}-square`}
+                  classes="icon-inline"
+                />
+              </button>
               <span className="mr-2">
                 <PersonListing person={cv.creator} />
               </span>
               {cv.comment.distinguished && (
                 <Icon icon="shield" inline classes={`text-danger mr-2`} />
               )}
-              {isMod_ && (
+              {this.isPostCreator && (
                 <div className="badge badge-light d-none d-sm-inline mr-2">
+                  {i18n.t("creator")}
+                </div>
+              )}
+              {isMod_ && (
+                <div className="badge d-none d-sm-inline mr-2">
                   {i18n.t("mod")}
                 </div>
               )}
               {isAdmin_ && (
-                <div className="badge badge-light d-none d-sm-inline mr-2">
+                <div className="badge d-none d-sm-inline mr-2">
                   {i18n.t("admin")}
                 </div>
               )}
-              {this.isPostCreator && (
-                <div className="badge badge-light d-none d-sm-inline mr-2">
-                  {i18n.t("creator")}
-                </div>
-              )}
               {cv.creator.bot_account && (
-                <div className="badge badge-light d-none d-sm-inline mr-2">
+                <div className="badge d-none d-sm-inline mr-2">
                   {i18n.t("bot_account").toLowerCase()}
                 </div>
               )}
-              {(cv.creator_banned_from_community || isBanned(cv.creator)) && (
-                <div className="badge badge-danger mr-2">
-                  {i18n.t("banned")}
-                </div>
-              )}
               {this.props.showCommunity && (
                 <>
                   <span className="mx-1">{i18n.t("to")}</span>
@@ -278,37 +354,40 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                   </Link>
                 </>
               )}
-              <button
-                className="btn btn-sm text-muted"
-                onClick={linkEvent(this, this.handleCommentCollapse)}
-                aria-label={this.expandText}
-                data-tippy-content={this.expandText}
-              >
-                {this.state.collapsed ? (
-                  <Icon icon="plus-square" classes="icon-inline" />
-                ) : (
-                  <Icon icon="minus-square" classes="icon-inline" />
-                )}
-              </button>
               {this.linkBtn(true)}
+              {cv.comment.language_id !== 0 && (
+                <span className="badge d-none d-sm-inline mr-2">
+                  {
+                    this.props.allLanguages.find(
+                      lang => lang.id === cv.comment.language_id
+                    )?.name
+                  }
+                </span>
+              )}
               {/* This is an expanding spacer for mobile */}
-              <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div>
+              <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" />
               {showScores() && (
                 <>
                   <a
                     className={`unselectable pointer ${this.scoreColor}`}
-                    onClick={this.handleCommentUpvote}
+                    onClick={linkEvent(this, this.handleUpvote)}
                     data-tippy-content={this.pointsTippy}
                   >
-                    <span
-                      className="mr-1 font-weight-bold"
-                      aria-label={i18n.t("number_of_points", {
-                        count: this.state.score,
-                        formattedCount: this.state.score,
-                      })}
-                    >
-                      {numToSI(this.state.score)}
-                    </span>
+                    {this.state.upvoteLoading ? (
+                      <Spinner />
+                    ) : (
+                      <span
+                        className="mr-1 font-weight-bold"
+                        aria-label={i18n.t("number_of_points", {
+                          count: Number(this.commentView.counts.score),
+                          formattedCount: numToSI(
+                            this.commentView.counts.score
+                          ),
+                        })}
+                      >
+                        {numToSI(this.commentView.counts.score)}
+                      </span>
+                    )}
                   </a>
                   <span className="mr-1">•</span>
                 </>
@@ -323,12 +402,17 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
             {/* end of user row */}
             {this.state.showEdit && (
               <CommentForm
-                node={Left(node)}
+                node={node}
                 edit
                 onReplyCancel={this.handleReplyCancel}
                 disabled={this.props.locked}
+                finished={this.props.finished.get(
+                  this.props.node.comment_view.comment.id
+                )}
                 focus
                 allLanguages={this.props.allLanguages}
+                siteLanguages={this.props.siteLanguages}
+                onUpsertComment={this.props.onEditComment}
               />
             )}
             {!this.state.showEdit && !this.state.collapsed && (
@@ -350,7 +434,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                   {this.props.markable && (
                     <button
                       className="btn btn-link btn-animate text-muted"
-                      onClick={linkEvent(this, this.handleMarkRead)}
+                      onClick={linkEvent(this, this.handleMarkAsRead)}
                       data-tippy-content={
                         this.commentReplyOrMentionRead
                           ? i18n.t("mark_as_unread")
@@ -363,7 +447,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                       }
                     >
                       {this.state.readLoading ? (
-                        this.loadingIcon
+                        <Spinner />
                       ) : (
                         <Icon
                           icon="check"
@@ -374,461 +458,499 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                       )}
                     </button>
                   )}
-                  {UserService.Instance.myUserInfo.isSome() &&
-                    !this.props.viewOnly && (
-                      <>
+                  {UserService.Instance.myUserInfo && !this.props.viewOnly && (
+                    <>
+                      <button
+                        className={`btn btn-link btn-animate ${
+                          this.commentView.my_vote === 1
+                            ? "text-info"
+                            : "text-muted"
+                        }`}
+                        onClick={linkEvent(this, this.handleUpvote)}
+                        data-tippy-content={i18n.t("upvote")}
+                        aria-label={i18n.t("upvote")}
+                        aria-pressed={this.commentView.my_vote === 1}
+                      >
+                        {this.state.upvoteLoading ? (
+                          <Spinner />
+                        ) : (
+                          <>
+                            <Icon icon="arrow-up1" classes="icon-inline" />
+                            {showScores() &&
+                              this.commentView.counts.upvotes !==
+                                this.commentView.counts.score && (
+                                <span className="ml-1">
+                                  {numToSI(this.commentView.counts.upvotes)}
+                                </span>
+                              )}
+                          </>
+                        )}
+                      </button>
+                      {this.props.enableDownvotes && (
                         <button
                           className={`btn btn-link btn-animate ${
-                            this.state.my_vote.unwrapOr(0) == 1
-                              ? "text-info"
+                            this.commentView.my_vote === -1
+                              ? "text-danger"
                               : "text-muted"
                           }`}
-                          onClick={this.handleCommentUpvote}
-                          data-tippy-content={i18n.t("upvote")}
-                          aria-label={i18n.t("upvote")}
+                          onClick={linkEvent(this, this.handleDownvote)}
+                          data-tippy-content={i18n.t("downvote")}
+                          aria-label={i18n.t("downvote")}
+                          aria-pressed={this.commentView.my_vote === -1}
                         >
-                          <Icon icon="arrow-up1" classes="icon-inline" />
-                          {showScores() &&
-                            this.state.upvotes !== this.state.score && (
-                              <span className="ml-1">
-                                {numToSI(this.state.upvotes)}
-                              </span>
-                            )}
+                          {this.state.downvoteLoading ? (
+                            <Spinner />
+                          ) : (
+                            <>
+                              <Icon icon="arrow-down1" classes="icon-inline" />
+                              {showScores() &&
+                                this.commentView.counts.upvotes !==
+                                  this.commentView.counts.score && (
+                                  <span className="ml-1">
+                                    {numToSI(this.commentView.counts.downvotes)}
+                                  </span>
+                                )}
+                            </>
+                          )}
                         </button>
-                        {this.props.enableDownvotes && (
-                          <button
-                            className={`btn btn-link btn-animate ${
-                              this.state.my_vote.unwrapOr(0) == -1
-                                ? "text-danger"
-                                : "text-muted"
-                            }`}
-                            onClick={this.handleCommentDownvote}
-                            data-tippy-content={i18n.t("downvote")}
-                            aria-label={i18n.t("downvote")}
-                          >
-                            <Icon icon="arrow-down1" classes="icon-inline" />
-                            {showScores() &&
-                              this.state.upvotes !== this.state.score && (
-                                <span className="ml-1">
-                                  {numToSI(this.state.downvotes)}
-                                </span>
-                              )}
-                          </button>
-                        )}
+                      )}
+                      <button
+                        className="btn btn-link btn-animate text-muted"
+                        onClick={linkEvent(this, this.handleReplyClick)}
+                        data-tippy-content={i18n.t("reply")}
+                        aria-label={i18n.t("reply")}
+                      >
+                        <Icon icon="reply1" classes="icon-inline" />
+                      </button>
+                      {!this.state.showAdvanced ? (
                         <button
                           className="btn btn-link btn-animate text-muted"
-                          onClick={linkEvent(this, this.handleReplyClick)}
-                          data-tippy-content={i18n.t("reply")}
-                          aria-label={i18n.t("reply")}
+                          onClick={linkEvent(this, this.handleShowAdvanced)}
+                          data-tippy-content={i18n.t("more")}
+                          aria-label={i18n.t("more")}
                         >
-                          <Icon icon="reply1" classes="icon-inline" />
+                          <Icon icon="more-vertical" classes="icon-inline" />
                         </button>
-                        {!this.state.showAdvanced ? (
+                      ) : (
+                        <>
+                          {!this.myComment && (
+                            <>
+                              <Link
+                                className="btn btn-link btn-animate text-muted"
+                                to={`/create_private_message/${cv.creator.id}`}
+                                title={i18n.t("message").toLowerCase()}
+                              >
+                                <Icon icon="mail" />
+                              </Link>
+                              <button
+                                className="btn btn-link btn-animate text-muted"
+                                onClick={linkEvent(
+                                  this,
+                                  this.handleShowReportDialog
+                                )}
+                                data-tippy-content={i18n.t(
+                                  "show_report_dialog"
+                                )}
+                                aria-label={i18n.t("show_report_dialog")}
+                              >
+                                <Icon icon="flag" />
+                              </button>
+                              <button
+                                className="btn btn-link btn-animate text-muted"
+                                onClick={linkEvent(
+                                  this,
+                                  this.handleBlockPerson
+                                )}
+                                data-tippy-content={i18n.t("block_user")}
+                                aria-label={i18n.t("block_user")}
+                              >
+                                {this.state.blockPersonLoading ? (
+                                  <Spinner />
+                                ) : (
+                                  <Icon icon="slash" />
+                                )}
+                              </button>
+                            </>
+                          )}
                           <button
                             className="btn btn-link btn-animate text-muted"
-                            onClick={linkEvent(this, this.handleShowAdvanced)}
-                            data-tippy-content={i18n.t("more")}
-                            aria-label={i18n.t("more")}
+                            onClick={linkEvent(this, this.handleSaveComment)}
+                            data-tippy-content={
+                              cv.saved ? i18n.t("unsave") : i18n.t("save")
+                            }
+                            aria-label={
+                              cv.saved ? i18n.t("unsave") : i18n.t("save")
+                            }
                           >
-                            <Icon icon="more-vertical" classes="icon-inline" />
+                            {this.state.saveLoading ? (
+                              <Spinner />
+                            ) : (
+                              <Icon
+                                icon="star"
+                                classes={`icon-inline ${
+                                  cv.saved && "text-warning"
+                                }`}
+                              />
+                            )}
                           </button>
-                        ) : (
-                          <>
-                            {!this.myComment && (
-                              <>
-                                <button className="btn btn-link btn-animate">
-                                  <Link
-                                    className="text-muted"
-                                    to={`/create_private_message/recipient/${cv.creator.id}`}
-                                    title={i18n.t("message").toLowerCase()}
-                                  >
-                                    <Icon icon="mail" />
-                                  </Link>
-                                </button>
+                          <button
+                            className="btn btn-link btn-animate text-muted"
+                            onClick={linkEvent(this, this.handleViewSource)}
+                            data-tippy-content={i18n.t("view_source")}
+                            aria-label={i18n.t("view_source")}
+                          >
+                            <Icon
+                              icon="file-text"
+                              classes={`icon-inline ${
+                                this.state.viewSource && "text-success"
+                              }`}
+                            />
+                          </button>
+                          {this.myComment && (
+                            <>
+                              <button
+                                className="btn btn-link btn-animate text-muted"
+                                onClick={linkEvent(this, this.handleEditClick)}
+                                data-tippy-content={i18n.t("edit")}
+                                aria-label={i18n.t("edit")}
+                              >
+                                <Icon icon="edit" classes="icon-inline" />
+                              </button>
+                              <button
+                                className="btn btn-link btn-animate text-muted"
+                                onClick={linkEvent(
+                                  this,
+                                  this.handleDeleteComment
+                                )}
+                                data-tippy-content={
+                                  !cv.comment.deleted
+                                    ? i18n.t("delete")
+                                    : i18n.t("restore")
+                                }
+                                aria-label={
+                                  !cv.comment.deleted
+                                    ? i18n.t("delete")
+                                    : i18n.t("restore")
+                                }
+                              >
+                                {this.state.deleteLoading ? (
+                                  <Spinner />
+                                ) : (
+                                  <Icon
+                                    icon="trash"
+                                    classes={`icon-inline ${
+                                      cv.comment.deleted && "text-danger"
+                                    }`}
+                                  />
+                                )}
+                              </button>
+
+                              {(canModOnSelf || canAdminOnSelf) && (
                                 <button
                                   className="btn btn-link btn-animate text-muted"
                                   onClick={linkEvent(
                                     this,
-                                    this.handleShowReportDialog
-                                  )}
-                                  data-tippy-content={i18n.t(
-                                    "show_report_dialog"
+                                    this.handleDistinguishComment
                                   )}
-                                  aria-label={i18n.t("show_report_dialog")}
+                                  data-tippy-content={
+                                    !cv.comment.distinguished
+                                      ? i18n.t("distinguish")
+                                      : i18n.t("undistinguish")
+                                  }
+                                  aria-label={
+                                    !cv.comment.distinguished
+                                      ? i18n.t("distinguish")
+                                      : i18n.t("undistinguish")
+                                  }
                                 >
-                                  <Icon icon="flag" />
+                                  <Icon
+                                    icon="shield"
+                                    classes={`icon-inline ${
+                                      cv.comment.distinguished && "text-danger"
+                                    }`}
+                                  />
                                 </button>
+                              )}
+                            </>
+                          )}
+                          {/* Admins and mods can remove comments */}
+                          {(canMod_ || canAdmin_) && (
+                            <>
+                              {!cv.comment.removed ? (
                                 <button
                                   className="btn btn-link btn-animate text-muted"
                                   onClick={linkEvent(
                                     this,
-                                    this.handleBlockUserClick
+                                    this.handleModRemoveShow
                                   )}
-                                  data-tippy-content={i18n.t("block_user")}
-                                  aria-label={i18n.t("block_user")}
+                                  aria-label={i18n.t("remove")}
                                 >
-                                  <Icon icon="slash" />
+                                  {i18n.t("remove")}
                                 </button>
-                              </>
-                            )}
-                            <button
-                              className="btn btn-link btn-animate text-muted"
-                              onClick={linkEvent(
-                                this,
-                                this.handleSaveCommentClick
-                              )}
-                              data-tippy-content={
-                                cv.saved ? i18n.t("unsave") : i18n.t("save")
-                              }
-                              aria-label={
-                                cv.saved ? i18n.t("unsave") : i18n.t("save")
-                              }
-                            >
-                              {this.state.saveLoading ? (
-                                this.loadingIcon
                               ) : (
-                                <Icon
-                                  icon="star"
-                                  classes={`icon-inline ${
-                                    cv.saved && "text-warning"
-                                  }`}
-                                />
-                              )}
-                            </button>
-                            <button
-                              className="btn btn-link btn-animate text-muted"
-                              onClick={linkEvent(this, this.handleViewSource)}
-                              data-tippy-content={i18n.t("view_source")}
-                              aria-label={i18n.t("view_source")}
-                            >
-                              <Icon
-                                icon="file-text"
-                                classes={`icon-inline ${
-                                  this.state.viewSource && "text-success"
-                                }`}
-                              />
-                            </button>
-                            {this.myComment && (
-                              <>
                                 <button
                                   className="btn btn-link btn-animate text-muted"
                                   onClick={linkEvent(
                                     this,
-                                    this.handleEditClick
+                                    this.handleRemoveComment
                                   )}
-                                  data-tippy-content={i18n.t("edit")}
-                                  aria-label={i18n.t("edit")}
+                                  aria-label={i18n.t("restore")}
                                 >
-                                  <Icon icon="edit" classes="icon-inline" />
-                                </button>
-                                <button
-                                  className="btn btn-link btn-animate text-muted"
-                                  onClick={linkEvent(
-                                    this,
-                                    this.handleDeleteClick
+                                  {this.state.removeLoading ? (
+                                    <Spinner />
+                                  ) : (
+                                    i18n.t("restore")
                                   )}
-                                  data-tippy-content={
-                                    !cv.comment.deleted
-                                      ? i18n.t("delete")
-                                      : i18n.t("restore")
-                                  }
-                                  aria-label={
-                                    !cv.comment.deleted
-                                      ? i18n.t("delete")
-                                      : i18n.t("restore")
-                                  }
-                                >
-                                  <Icon
-                                    icon="trash"
-                                    classes={`icon-inline ${
-                                      cv.comment.deleted && "text-danger"
-                                    }`}
-                                  />
                                 </button>
-
-                                {(canModOnSelf || canAdminOnSelf) && (
+                              )}
+                            </>
+                          )}
+                          {/* Mods can ban from community, and appoint as mods to community */}
+                          {canMod_ && (
+                            <>
+                              {!isMod_ &&
+                                (!cv.creator_banned_from_community ? (
                                   <button
                                     className="btn btn-link btn-animate text-muted"
                                     onClick={linkEvent(
                                       this,
-                                      this.handleDistinguishClick
+                                      this.handleModBanFromCommunityShow
                                     )}
-                                    data-tippy-content={
-                                      !cv.comment.distinguished
-                                        ? i18n.t("distinguish")
-                                        : i18n.t("undistinguish")
-                                    }
-                                    aria-label={
-                                      !cv.comment.distinguished
-                                        ? i18n.t("distinguish")
-                                        : i18n.t("undistinguish")
-                                    }
+                                    aria-label={i18n.t("ban_from_community")}
                                   >
-                                    <Icon
-                                      icon="shield"
-                                      classes={`icon-inline ${
-                                        cv.comment.distinguished &&
-                                        "text-danger"
-                                      }`}
-                                    />
+                                    {i18n.t("ban_from_community")}
                                   </button>
-                                )}
-                              </>
-                            )}
-                            {/* Admins and mods can remove comments */}
-                            {(canMod_ || canAdmin_) && (
-                              <>
-                                {!cv.comment.removed ? (
+                                ) : (
                                   <button
                                     className="btn btn-link btn-animate text-muted"
                                     onClick={linkEvent(
                                       this,
-                                      this.handleModRemoveShow
+                                      this.handleBanPersonFromCommunity
                                     )}
-                                    aria-label={i18n.t("remove")}
+                                    aria-label={i18n.t("unban")}
                                   >
-                                    {i18n.t("remove")}
+                                    {this.state.banLoading ? (
+                                      <Spinner />
+                                    ) : (
+                                      i18n.t("unban")
+                                    )}
                                   </button>
-                                ) : (
+                                ))}
+                              {!cv.creator_banned_from_community &&
+                                (!this.state.showConfirmAppointAsMod ? (
                                   <button
                                     className="btn btn-link btn-animate text-muted"
                                     onClick={linkEvent(
                                       this,
-                                      this.handleModRemoveSubmit
+                                      this.handleShowConfirmAppointAsMod
                                     )}
-                                    aria-label={i18n.t("restore")}
+                                    aria-label={
+                                      isMod_
+                                        ? i18n.t("remove_as_mod")
+                                        : i18n.t("appoint_as_mod")
+                                    }
                                   >
-                                    {i18n.t("restore")}
+                                    {isMod_
+                                      ? i18n.t("remove_as_mod")
+                                      : i18n.t("appoint_as_mod")}
                                   </button>
-                                )}
-                              </>
-                            )}
-                            {/* Mods can ban from community, and appoint as mods to community */}
-                            {canMod_ && (
-                              <>
-                                {!isMod_ &&
-                                  (!cv.creator_banned_from_community ? (
+                                ) : (
+                                  <>
                                     <button
                                       className="btn btn-link btn-animate text-muted"
-                                      onClick={linkEvent(
-                                        this,
-                                        this.handleModBanFromCommunityShow
-                                      )}
-                                      aria-label={i18n.t("ban")}
+                                      aria-label={i18n.t("are_you_sure")}
                                     >
-                                      {i18n.t("ban")}
+                                      {i18n.t("are_you_sure")}
                                     </button>
-                                  ) : (
                                     <button
                                       className="btn btn-link btn-animate text-muted"
                                       onClick={linkEvent(
                                         this,
-                                        this.handleModBanFromCommunitySubmit
+                                        this.handleAddModToCommunity
                                       )}
-                                      aria-label={i18n.t("unban")}
+                                      aria-label={i18n.t("yes")}
                                     >
-                                      {i18n.t("unban")}
+                                      {this.state.addModLoading ? (
+                                        <Spinner />
+                                      ) : (
+                                        i18n.t("yes")
+                                      )}
                                     </button>
-                                  ))}
-                                {!cv.creator_banned_from_community &&
-                                  (!this.state.showConfirmAppointAsMod ? (
                                     <button
                                       className="btn btn-link btn-animate text-muted"
                                       onClick={linkEvent(
                                         this,
-                                        this.handleShowConfirmAppointAsMod
+                                        this.handleCancelConfirmAppointAsMod
                                       )}
-                                      aria-label={
-                                        isMod_
-                                          ? i18n.t("remove_as_mod")
-                                          : i18n.t("appoint_as_mod")
-                                      }
+                                      aria-label={i18n.t("no")}
                                     >
-                                      {isMod_
-                                        ? i18n.t("remove_as_mod")
-                                        : i18n.t("appoint_as_mod")}
+                                      {i18n.t("no")}
                                     </button>
+                                  </>
+                                ))}
+                            </>
+                          )}
+                          {/* Community creators and admins can transfer community to another mod */}
+                          {(amCommunityCreator_ || canAdmin_) &&
+                            isMod_ &&
+                            cv.creator.local &&
+                            (!this.state.showConfirmTransferCommunity ? (
+                              <button
+                                className="btn btn-link btn-animate text-muted"
+                                onClick={linkEvent(
+                                  this,
+                                  this.handleShowConfirmTransferCommunity
+                                )}
+                                aria-label={i18n.t("transfer_community")}
+                              >
+                                {i18n.t("transfer_community")}
+                              </button>
+                            ) : (
+                              <>
+                                <button
+                                  className="btn btn-link btn-animate text-muted"
+                                  aria-label={i18n.t("are_you_sure")}
+                                >
+                                  {i18n.t("are_you_sure")}
+                                </button>
+                                <button
+                                  className="btn btn-link btn-animate text-muted"
+                                  onClick={linkEvent(
+                                    this,
+                                    this.handleTransferCommunity
+                                  )}
+                                  aria-label={i18n.t("yes")}
+                                >
+                                  {this.state.transferCommunityLoading ? (
+                                    <Spinner />
                                   ) : (
-                                    <>
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        aria-label={i18n.t("are_you_sure")}
-                                      >
-                                        {i18n.t("are_you_sure")}
-                                      </button>
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        onClick={linkEvent(
-                                          this,
-                                          this.handleAddModToCommunity
-                                        )}
-                                        aria-label={i18n.t("yes")}
-                                      >
-                                        {i18n.t("yes")}
-                                      </button>
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        onClick={linkEvent(
-                                          this,
-                                          this.handleCancelConfirmAppointAsMod
-                                        )}
-                                        aria-label={i18n.t("no")}
-                                      >
-                                        {i18n.t("no")}
-                                      </button>
-                                    </>
-                                  ))}
-                              </>
-                            )}
-                            {/* Community creators and admins can transfer community to another mod */}
-                            {(amCommunityCreator_ || canAdmin_) &&
-                              isMod_ &&
-                              cv.creator.local &&
-                              (!this.state.showConfirmTransferCommunity ? (
+                                    i18n.t("yes")
+                                  )}
+                                </button>
                                 <button
                                   className="btn btn-link btn-animate text-muted"
                                   onClick={linkEvent(
                                     this,
-                                    this.handleShowConfirmTransferCommunity
+                                    this
+                                      .handleCancelShowConfirmTransferCommunity
                                   )}
-                                  aria-label={i18n.t("transfer_community")}
+                                  aria-label={i18n.t("no")}
                                 >
-                                  {i18n.t("transfer_community")}
+                                  {i18n.t("no")}
                                 </button>
-                              ) : (
+                              </>
+                            ))}
+                          {/* Admins can ban from all, and appoint other admins */}
+                          {canAdmin_ && (
+                            <>
+                              {!isAdmin_ && (
                                 <>
-                                  <button
-                                    className="btn btn-link btn-animate text-muted"
-                                    aria-label={i18n.t("are_you_sure")}
-                                  >
-                                    {i18n.t("are_you_sure")}
-                                  </button>
                                   <button
                                     className="btn btn-link btn-animate text-muted"
                                     onClick={linkEvent(
                                       this,
-                                      this.handleTransferCommunity
+                                      this.handlePurgePersonShow
                                     )}
-                                    aria-label={i18n.t("yes")}
+                                    aria-label={i18n.t("purge_user")}
                                   >
-                                    {i18n.t("yes")}
+                                    {i18n.t("purge_user")}
                                   </button>
                                   <button
                                     className="btn btn-link btn-animate text-muted"
                                     onClick={linkEvent(
                                       this,
-                                      this
-                                        .handleCancelShowConfirmTransferCommunity
+                                      this.handlePurgeCommentShow
                                     )}
-                                    aria-label={i18n.t("no")}
+                                    aria-label={i18n.t("purge_comment")}
                                   >
-                                    {i18n.t("no")}
+                                    {i18n.t("purge_comment")}
                                   </button>
-                                </>
-                              ))}
-                            {/* Admins can ban from all, and appoint other admins */}
-                            {canAdmin_ && (
-                              <>
-                                {!isAdmin_ && (
-                                  <>
+
+                                  {!isBanned(cv.creator) ? (
                                     <button
                                       className="btn btn-link btn-animate text-muted"
                                       onClick={linkEvent(
                                         this,
-                                        this.handlePurgePersonShow
+                                        this.handleModBanShow
                                       )}
-                                      aria-label={i18n.t("purge_user")}
+                                      aria-label={i18n.t("ban_from_site")}
                                     >
-                                      {i18n.t("purge_user")}
+                                      {i18n.t("ban_from_site")}
                                     </button>
+                                  ) : (
                                     <button
                                       className="btn btn-link btn-animate text-muted"
                                       onClick={linkEvent(
                                         this,
-                                        this.handlePurgeCommentShow
+                                        this.handleBanPerson
                                       )}
-                                      aria-label={i18n.t("purge_comment")}
+                                      aria-label={i18n.t("unban_from_site")}
                                     >
-                                      {i18n.t("purge_comment")}
+                                      {this.state.banLoading ? (
+                                        <Spinner />
+                                      ) : (
+                                        i18n.t("unban_from_site")
+                                      )}
                                     </button>
-
-                                    {!isBanned(cv.creator) ? (
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        onClick={linkEvent(
-                                          this,
-                                          this.handleModBanShow
-                                        )}
-                                        aria-label={i18n.t("ban_from_site")}
-                                      >
-                                        {i18n.t("ban_from_site")}
-                                      </button>
-                                    ) : (
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        onClick={linkEvent(
-                                          this,
-                                          this.handleModBanSubmit
-                                        )}
-                                        aria-label={i18n.t("unban_from_site")}
-                                      >
-                                        {i18n.t("unban_from_site")}
-                                      </button>
+                                  )}
+                                </>
+                              )}
+                              {!isBanned(cv.creator) &&
+                                cv.creator.local &&
+                                (!this.state.showConfirmAppointAsAdmin ? (
+                                  <button
+                                    className="btn btn-link btn-animate text-muted"
+                                    onClick={linkEvent(
+                                      this,
+                                      this.handleShowConfirmAppointAsAdmin
                                     )}
-                                  </>
-                                )}
-                                {!isBanned(cv.creator) &&
-                                  cv.creator.local &&
-                                  (!this.state.showConfirmAppointAsAdmin ? (
+                                    aria-label={
+                                      isAdmin_
+                                        ? i18n.t("remove_as_admin")
+                                        : i18n.t("appoint_as_admin")
+                                    }
+                                  >
+                                    {isAdmin_
+                                      ? i18n.t("remove_as_admin")
+                                      : i18n.t("appoint_as_admin")}
+                                  </button>
+                                ) : (
+                                  <>
+                                    <button className="btn btn-link btn-animate text-muted">
+                                      {i18n.t("are_you_sure")}
+                                    </button>
                                     <button
                                       className="btn btn-link btn-animate text-muted"
                                       onClick={linkEvent(
                                         this,
-                                        this.handleShowConfirmAppointAsAdmin
+                                        this.handleAddAdmin
                                       )}
-                                      aria-label={
-                                        isAdmin_
-                                          ? i18n.t("remove_as_admin")
-                                          : i18n.t("appoint_as_admin")
-                                      }
+                                      aria-label={i18n.t("yes")}
                                     >
-                                      {isAdmin_
-                                        ? i18n.t("remove_as_admin")
-                                        : i18n.t("appoint_as_admin")}
+                                      {this.state.addAdminLoading ? (
+                                        <Spinner />
+                                      ) : (
+                                        i18n.t("yes")
+                                      )}
                                     </button>
-                                  ) : (
-                                    <>
-                                      <button className="btn btn-link btn-animate text-muted">
-                                        {i18n.t("are_you_sure")}
-                                      </button>
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        onClick={linkEvent(
-                                          this,
-                                          this.handleAddAdmin
-                                        )}
-                                        aria-label={i18n.t("yes")}
-                                      >
-                                        {i18n.t("yes")}
-                                      </button>
-                                      <button
-                                        className="btn btn-link btn-animate text-muted"
-                                        onClick={linkEvent(
-                                          this,
-                                          this.handleCancelConfirmAppointAsAdmin
-                                        )}
-                                        aria-label={i18n.t("no")}
-                                      >
-                                        {i18n.t("no")}
-                                      </button>
-                                    </>
-                                  ))}
-                              </>
-                            )}
-                          </>
-                        )}
-                      </>
-                    )}
+                                    <button
+                                      className="btn btn-link btn-animate text-muted"
+                                      onClick={linkEvent(
+                                        this,
+                                        this.handleCancelConfirmAppointAsAdmin
+                                      )}
+                                      aria-label={i18n.t("no")}
+                                    >
+                                      {i18n.t("no")}
+                                    </button>
+                                  </>
+                                ))}
+                            </>
+                          )}
+                        </>
+                      )}
+                    </>
+                  )}
                 </div>
                 {/* end of button group */}
               </div>
@@ -846,11 +968,19 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
               className="btn btn-link text-muted"
               onClick={linkEvent(this, this.handleFetchChildren)}
             >
-              {i18n.t("x_more_replies", {
-                count: node.comment_view.counts.child_count,
-                formattedCount: numToSI(node.comment_view.counts.child_count),
-              })}{" "}
-              ➔
+              {this.state.fetchChildrenLoading ? (
+                <Spinner />
+              ) : (
+                <>
+                  {i18n.t("x_more_replies", {
+                    count: node.comment_view.counts.child_count,
+                    formattedCount: numToSI(
+                      node.comment_view.counts.child_count
+                    ),
+                  })}{" "}
+                  ➔
+                </>
+              )}
             </button>
           </div>
         )}
@@ -858,7 +988,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
         {this.state.showRemoveDialog && (
           <form
             className="form-inline"
-            onSubmit={linkEvent(this, this.handleModRemoveSubmit)}
+            onSubmit={linkEvent(this, this.handleRemoveComment)}
           >
             <label
               className="sr-only"
@@ -871,7 +1001,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
               id={`mod-remove-reason-${cv.comment.id}`}
               className="form-control mr-2"
               placeholder={i18n.t("reason")}
-              value={toUndefined(this.state.removeReason)}
+              value={this.state.removeReason}
               onInput={linkEvent(this, this.handleModRemoveReasonChange)}
             />
             <button
@@ -886,7 +1016,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
         {this.state.showReportDialog && (
           <form
             className="form-inline"
-            onSubmit={linkEvent(this, this.handleReportSubmit)}
+            onSubmit={linkEvent(this, this.handleReportComment)}
           >
             <label
               className="sr-only"
@@ -926,7 +1056,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                 id={`mod-ban-reason-${cv.comment.id}`}
                 className="form-control mr-2"
                 placeholder={i18n.t("reason")}
-                value={toUndefined(this.state.banReason)}
+                value={this.state.banReason}
                 onInput={linkEvent(this, this.handleModBanReasonChange)}
               />
               <label
@@ -940,7 +1070,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                 id={`mod-ban-expires-${cv.comment.id}`}
                 className="form-control mr-2"
                 placeholder={i18n.t("number_of_days")}
-                value={toUndefined(this.state.banExpireDays)}
+                value={this.state.banExpireDays}
                 onInput={linkEvent(this, this.handleModBanExpireDaysChange)}
               />
               <div className="form-group">
@@ -973,14 +1103,20 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                 className="btn btn-secondary"
                 aria-label={i18n.t("ban")}
               >
-                {i18n.t("ban")} {cv.creator.name}
+                {this.state.banLoading ? (
+                  <Spinner />
+                ) : (
+                  <span>
+                    {i18n.t("ban")} {cv.creator.name}
+                  </span>
+                )}
               </button>
             </div>
           </form>
         )}
 
         {this.state.showPurgeDialog && (
-          <form onSubmit={linkEvent(this, this.handlePurgeSubmit)}>
+          <form onSubmit={linkEvent(this, this.handlePurgeBothSubmit)}>
             <PurgeWarning />
             <label className="sr-only" htmlFor="purge-reason">
               {i18n.t("reason")}
@@ -990,7 +1126,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
               id="purge-reason"
               className="form-control my-3"
               placeholder={i18n.t("reason")}
-              value={toUndefined(this.state.purgeReason)}
+              value={this.state.purgeReason}
               onInput={linkEvent(this, this.handlePurgeReasonChange)}
             />
             <div className="form-group row col-12">
@@ -1010,11 +1146,16 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
         )}
         {this.state.showReply && (
           <CommentForm
-            node={Left(node)}
+            node={node}
             onReplyCancel={this.handleReplyCancel}
             disabled={this.props.locked}
+            finished={this.props.finished.get(
+              this.props.node.comment_view.comment.id
+            )}
             focus
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
+            onUpsertComment={this.props.onCreateComment}
           />
         )}
         {!this.state.collapsed && node.children.length > 0 && (
@@ -1023,11 +1164,31 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
             locked={this.props.locked}
             moderators={this.props.moderators}
             admins={this.props.admins}
-            maxCommentsShown={None}
             enableDownvotes={this.props.enableDownvotes}
             viewType={this.props.viewType}
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
             hideImages={this.props.hideImages}
+            finished={this.props.finished}
+            onCommentReplyRead={this.props.onCommentReplyRead}
+            onPersonMentionRead={this.props.onPersonMentionRead}
+            onCreateComment={this.props.onCreateComment}
+            onEditComment={this.props.onEditComment}
+            onCommentVote={this.props.onCommentVote}
+            onBlockPerson={this.props.onBlockPerson}
+            onSaveComment={this.props.onSaveComment}
+            onDeleteComment={this.props.onDeleteComment}
+            onRemoveComment={this.props.onRemoveComment}
+            onDistinguishComment={this.props.onDistinguishComment}
+            onAddModToCommunity={this.props.onAddModToCommunity}
+            onAddAdmin={this.props.onAddAdmin}
+            onBanPersonFromCommunity={this.props.onBanPersonFromCommunity}
+            onBanPerson={this.props.onBanPerson}
+            onTransferCommunity={this.props.onTransferCommunity}
+            onFetchChildren={this.props.onFetchChildren}
+            onCommentReport={this.props.onCommentReport}
+            onPurgePerson={this.props.onPurgePerson}
+            onPurgeComment={this.props.onPurgeComment}
           />
         )}
         {/* A collapsed clearfix */}
@@ -1037,7 +1198,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   get commentReplyOrMentionRead(): boolean {
-    let cv = this.props.node.comment_view;
+    const cv = this.commentView;
 
     if (this.isPersonMentionType(cv)) {
       return cv.person_mention.read;
@@ -1049,20 +1210,23 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   linkBtn(small = false) {
-    let cv = this.props.node.comment_view;
-    let classnames = classNames("btn btn-link btn-animate text-muted", {
+    const cv = this.commentView;
+    const classnames = classNames("btn btn-link btn-animate text-muted", {
       "btn-sm": small,
     });
 
-    let title = this.props.showContext
+    const title = this.props.showContext
       ? i18n.t("show_context")
       : i18n.t("link");
 
+    // The context button should show the parent comment by default
+    const parentCommentId = getCommentParentId(cv.comment) ?? cv.comment.id;
+
     return (
       <>
         <Link
           className={classnames}
-          to={`/comment/${cv.comment.id}`}
+          to={`/comment/${parentCommentId}`}
           title={title}
         >
           <Icon icon="link" classes="icon-inline" />
@@ -1076,28 +1240,52 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     );
   }
 
-  get loadingIcon() {
-    return <Spinner />;
-  }
-
   get myComment(): boolean {
-    return UserService.Instance.myUserInfo
-      .map(
-        m =>
-          m.local_user_view.person.id == this.props.node.comment_view.creator.id
-      )
-      .unwrapOr(false);
+    return (
+      UserService.Instance.myUserInfo?.local_user_view.person.id ==
+      this.commentView.creator.id
+    );
   }
 
   get isPostCreator(): boolean {
-    return (
-      this.props.node.comment_view.creator.id ==
-      this.props.node.comment_view.post.creator_id
-    );
+    return this.commentView.creator.id == this.commentView.post.creator_id;
+  }
+
+  get scoreColor() {
+    if (this.commentView.my_vote == 1) {
+      return "text-info";
+    } else if (this.commentView.my_vote == -1) {
+      return "text-danger";
+    } else {
+      return "text-muted";
+    }
+  }
+
+  get pointsTippy(): string {
+    const points = i18n.t("number_of_points", {
+      count: Number(this.commentView.counts.score),
+      formattedCount: numToSI(this.commentView.counts.score),
+    });
+
+    const upvotes = i18n.t("number_of_upvotes", {
+      count: Number(this.commentView.counts.upvotes),
+      formattedCount: numToSI(this.commentView.counts.upvotes),
+    });
+
+    const downvotes = i18n.t("number_of_downvotes", {
+      count: Number(this.commentView.counts.downvotes),
+      formattedCount: numToSI(this.commentView.counts.downvotes),
+    });
+
+    return `${points} • ${upvotes} • ${downvotes}`;
+  }
+
+  get expandText(): string {
+    return this.state.collapsed ? i18n.t("expand") : i18n.t("collapse");
   }
 
   get commentUnlessRemoved(): string {
-    let comment = this.props.node.comment_view.comment;
+    const comment = this.commentView.comment;
     return comment.removed
       ? `*${i18n.t("removed")}*`
       : comment.deleted
@@ -1113,112 +1301,10 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     i.setState({ showEdit: true });
   }
 
-  handleBlockUserClick(i: CommentNode) {
-    let blockUserForm = new BlockPerson({
-      person_id: i.props.node.comment_view.creator.id,
-      block: true,
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.blockPerson(blockUserForm));
-  }
-
-  handleDeleteClick(i: CommentNode) {
-    let comment = i.props.node.comment_view.comment;
-    let deleteForm = new DeleteComment({
-      comment_id: comment.id,
-      deleted: !comment.deleted,
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.deleteComment(deleteForm));
-  }
-
-  handleSaveCommentClick(i: CommentNode) {
-    let cv = i.props.node.comment_view;
-    let save = cv.saved == undefined ? true : !cv.saved;
-    let form = new SaveComment({
-      comment_id: cv.comment.id,
-      save,
-      auth: auth().unwrap(),
-    });
-
-    WebSocketService.Instance.send(wsClient.saveComment(form));
-
-    i.setState({ saveLoading: true });
-  }
-
   handleReplyCancel() {
     this.setState({ showReply: false, showEdit: false });
   }
 
-  handleCommentUpvote(event: any) {
-    event.preventDefault();
-    let myVote = this.state.my_vote.unwrapOr(0);
-    let newVote = myVote == 1 ? 0 : 1;
-
-    if (myVote == 1) {
-      this.setState({
-        score: this.state.score - 1,
-        upvotes: this.state.upvotes - 1,
-      });
-    } else if (myVote == -1) {
-      this.setState({
-        downvotes: this.state.downvotes - 1,
-        upvotes: this.state.upvotes + 1,
-        score: this.state.score + 2,
-      });
-    } else {
-      this.setState({
-        score: this.state.score + 1,
-        upvotes: this.state.upvotes + 1,
-      });
-    }
-
-    this.setState({ my_vote: Some(newVote) });
-
-    let form = new CreateCommentLike({
-      comment_id: this.props.node.comment_view.comment.id,
-      score: newVote,
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.likeComment(form));
-    setupTippy();
-  }
-
-  handleCommentDownvote(event: any) {
-    event.preventDefault();
-    let myVote = this.state.my_vote.unwrapOr(0);
-    let newVote = myVote == -1 ? 0 : -1;
-
-    if (myVote == 1) {
-      this.setState({
-        downvotes: this.state.downvotes + 1,
-        upvotes: this.state.upvotes - 1,
-        score: this.state.score - 2,
-      });
-    } else if (myVote == -1) {
-      this.setState({
-        downvotes: this.state.downvotes - 1,
-        score: this.state.score + 1,
-      });
-    } else {
-      this.setState({
-        downvotes: this.state.downvotes + 1,
-        score: this.state.score - 1,
-      });
-    }
-
-    this.setState({ my_vote: Some(newVote) });
-
-    let form = new CreateCommentLike({
-      comment_id: this.props.node.comment_view.comment.id,
-      score: newVote,
-      auth: auth().unwrap(),
-    });
-
-    WebSocketService.Instance.send(wsClient.likeComment(form));
-    setupTippy();
-  }
-
   handleShowReportDialog(i: CommentNode) {
     i.setState({ showReportDialog: !i.state.showReportDialog });
   }
@@ -1227,18 +1313,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     i.setState({ reportReason: event.target.value });
   }
 
-  handleReportSubmit(i: CommentNode) {
-    let comment = i.props.node.comment_view.comment;
-    let form = new CreateCommentReport({
-      comment_id: comment.id,
-      reason: i.state.reportReason,
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.createCommentReport(form));
-
-    i.setState({ showReportDialog: false });
-  }
-
   handleModRemoveShow(i: CommentNode) {
     i.setState({
       showRemoveDialog: !i.state.showRemoveDialog,
@@ -1247,40 +1321,13 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   handleModRemoveReasonChange(i: CommentNode, event: any) {
-    i.setState({ removeReason: Some(event.target.value) });
+    i.setState({ removeReason: event.target.value });
   }
 
   handleModRemoveDataChange(i: CommentNode, event: any) {
     i.setState({ removeData: event.target.checked });
   }
 
-  handleModRemoveSubmit(i: CommentNode) {
-    let comment = i.props.node.comment_view.comment;
-    let form = new RemoveComment({
-      comment_id: comment.id,
-      removed: !comment.removed,
-      reason: i.state.removeReason,
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.removeComment(form));
-
-    i.setState({ showRemoveDialog: false });
-  }
-
-  handleDistinguishClick(i: CommentNode) {
-    let comment = i.props.node.comment_view.comment;
-    let form = new EditComment({
-      comment_id: comment.id,
-      form_id: None, // TODO not sure about this
-      content: None,
-      distinguished: Some(!comment.distinguished),
-      language_id: Some(comment.language_id),
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.editComment(form));
-    i.setState(i.state);
-  }
-
   isPersonMentionType(
     item: CommentView | PersonMentionView | CommentReplyView
   ): item is PersonMentionView {
@@ -1293,26 +1340,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     return (item as CommentReplyView).comment_reply?.id !== undefined;
   }
 
-  handleMarkRead(i: CommentNode) {
-    if (i.isPersonMentionType(i.props.node.comment_view)) {
-      let form = new MarkPersonMentionAsRead({
-        person_mention_id: i.props.node.comment_view.person_mention.id,
-        read: !i.props.node.comment_view.person_mention.read,
-        auth: auth().unwrap(),
-      });
-      WebSocketService.Instance.send(wsClient.markPersonMentionAsRead(form));
-    } else if (i.isCommentReplyType(i.props.node.comment_view)) {
-      let form = new MarkCommentReplyAsRead({
-        comment_reply_id: i.props.node.comment_view.comment_reply.id,
-        read: !i.props.node.comment_view.comment_reply.read,
-        auth: auth().unwrap(),
-      });
-      WebSocketService.Instance.send(wsClient.markCommentReplyAsRead(form));
-    }
-
-    i.setState({ readLoading: true });
-  }
-
   handleModBanFromCommunityShow(i: CommentNode) {
     i.setState({
       showBanDialog: true,
@@ -1330,60 +1357,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   handleModBanReasonChange(i: CommentNode, event: any) {
-    i.setState({ banReason: Some(event.target.value) });
+    i.setState({ banReason: event.target.value });
   }
 
   handleModBanExpireDaysChange(i: CommentNode, event: any) {
-    i.setState({ banExpireDays: Some(event.target.value) });
-  }
-
-  handleModBanFromCommunitySubmit(i: CommentNode) {
-    i.setState({ banType: BanType.Community });
-    i.handleModBanBothSubmit(i);
-  }
-
-  handleModBanSubmit(i: CommentNode) {
-    i.setState({ banType: BanType.Site });
-    i.handleModBanBothSubmit(i);
-  }
-
-  handleModBanBothSubmit(i: CommentNode) {
-    let cv = i.props.node.comment_view;
-
-    if (i.state.banType == BanType.Community) {
-      // If its an unban, restore all their data
-      let ban = !cv.creator_banned_from_community;
-      if (ban == false) {
-        i.setState({ removeData: false });
-      }
-      let form = new BanFromCommunity({
-        person_id: cv.creator.id,
-        community_id: cv.community.id,
-        ban,
-        remove_data: Some(i.state.removeData),
-        reason: i.state.banReason,
-        expires: i.state.banExpireDays.map(futureDaysToUnixTime),
-        auth: auth().unwrap(),
-      });
-      WebSocketService.Instance.send(wsClient.banFromCommunity(form));
-    } else {
-      // If its an unban, restore all their data
-      let ban = !cv.creator.banned;
-      if (ban == false) {
-        i.setState({ removeData: false });
-      }
-      let form = new BanPerson({
-        person_id: cv.creator.id,
-        ban,
-        remove_data: Some(i.state.removeData),
-        reason: i.state.banReason,
-        expires: i.state.banExpireDays.map(futureDaysToUnixTime),
-        auth: auth().unwrap(),
-      });
-      WebSocketService.Instance.send(wsClient.banPerson(form));
-    }
-
-    i.setState({ showBanDialog: false });
+    i.setState({ banExpireDays: event.target.value });
   }
 
   handlePurgePersonShow(i: CommentNode) {
@@ -1403,29 +1381,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   handlePurgeReasonChange(i: CommentNode, event: any) {
-    i.setState({ purgeReason: Some(event.target.value) });
-  }
-
-  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.setState({ purgeLoading: true });
+    i.setState({ purgeReason: event.target.value });
   }
 
   handleShowConfirmAppointAsMod(i: CommentNode) {
@@ -1436,18 +1392,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     i.setState({ showConfirmAppointAsMod: false });
   }
 
-  handleAddModToCommunity(i: CommentNode) {
-    let cv = i.props.node.comment_view;
-    let form = new AddModToCommunity({
-      person_id: cv.creator.id,
-      community_id: cv.community.id,
-      added: !isMod(i.props.moderators, cv.creator.id),
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.addModToCommunity(form));
-    i.setState({ showConfirmAppointAsMod: false });
-  }
-
   handleShowConfirmAppointAsAdmin(i: CommentNode) {
     i.setState({ showConfirmAppointAsAdmin: true });
   }
@@ -1456,17 +1400,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     i.setState({ showConfirmAppointAsAdmin: false });
   }
 
-  handleAddAdmin(i: CommentNode) {
-    let creatorId = i.props.node.comment_view.creator.id;
-    let form = new AddAdmin({
-      person_id: creatorId,
-      added: !isAdmin(i.props.admins, creatorId),
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.addAdmin(form));
-    i.setState({ showConfirmAppointAsAdmin: false });
-  }
-
   handleShowConfirmTransferCommunity(i: CommentNode) {
     i.setState({ showConfirmTransferCommunity: true });
   }
@@ -1475,17 +1408,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     i.setState({ showConfirmTransferCommunity: false });
   }
 
-  handleTransferCommunity(i: CommentNode) {
-    let cv = i.props.node.comment_view;
-    let form = new TransferCommunity({
-      community_id: cv.community.id,
-      person_id: cv.creator.id,
-      auth: auth().unwrap(),
-    });
-    WebSocketService.Instance.send(wsClient.transferCommunity(form));
-    i.setState({ showConfirmTransferCommunity: false });
-  }
-
   handleShowConfirmTransferSite(i: CommentNode) {
     i.setState({ showConfirmTransferSite: true });
   }
@@ -1495,8 +1417,8 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   get isCommentNew(): boolean {
-    let now = moment.utc().subtract(10, "minutes");
-    let then = moment.utc(this.props.node.comment_view.comment.published);
+    const now = moment.utc().subtract(10, "minutes");
+    const then = moment.utc(this.commentView.comment.published);
     return now.isBefore(then);
   }
 
@@ -1514,54 +1436,193 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
     setupTippy();
   }
 
-  handleFetchChildren(i: CommentNode) {
-    let form = new GetComments({
-      post_id: Some(i.props.node.comment_view.post.id),
-      parent_id: Some(i.props.node.comment_view.comment.id),
-      max_depth: Some(commentTreeMaxDepth),
-      page: None,
-      sort: None,
-      limit: Some(999),
-      type_: Some(ListingType.All),
-      community_name: None,
-      community_id: None,
-      saved_only: Some(false),
-      auth: auth(false).ok(),
+  handleSaveComment(i: CommentNode) {
+    i.setState({ saveLoading: true });
+
+    i.props.onSaveComment({
+      comment_id: i.commentView.comment.id,
+      save: !i.commentView.saved,
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleUpvote(i: CommentNode) {
+    i.setState({ upvoteLoading: true });
+    i.props.onCommentVote({
+      comment_id: i.commentId,
+      score: newVote(VoteType.Upvote, i.commentView.my_vote),
+      auth: myAuthRequired(),
     });
+  }
 
-    WebSocketService.Instance.send(wsClient.getComments(form));
+  handleDownvote(i: CommentNode) {
+    i.setState({ downvoteLoading: true });
+    i.props.onCommentVote({
+      comment_id: i.commentId,
+      score: newVote(VoteType.Downvote, i.commentView.my_vote),
+      auth: myAuthRequired(),
+    });
   }
 
-  get scoreColor() {
-    if (this.state.my_vote.unwrapOr(0) == 1) {
-      return "text-info";
-    } else if (this.state.my_vote.unwrapOr(0) == -1) {
-      return "text-danger";
+  handleBlockPerson(i: CommentNode) {
+    i.setState({ blockPersonLoading: true });
+    i.props.onBlockPerson({
+      person_id: i.commentView.creator.id,
+      block: true,
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleMarkAsRead(i: CommentNode) {
+    i.setState({ readLoading: true });
+    const cv = i.commentView;
+    if (i.isPersonMentionType(cv)) {
+      i.props.onPersonMentionRead({
+        person_mention_id: cv.person_mention.id,
+        read: !cv.person_mention.read,
+        auth: myAuthRequired(),
+      });
+    } else if (i.isCommentReplyType(cv)) {
+      i.props.onCommentReplyRead({
+        comment_reply_id: cv.comment_reply.id,
+        read: !cv.comment_reply.read,
+        auth: myAuthRequired(),
+      });
+    }
+  }
+
+  handleDeleteComment(i: CommentNode) {
+    i.setState({ deleteLoading: true });
+    i.props.onDeleteComment({
+      comment_id: i.commentId,
+      deleted: !i.commentView.comment.deleted,
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleRemoveComment(i: CommentNode, event: any) {
+    event.preventDefault();
+    i.setState({ removeLoading: true });
+    i.props.onRemoveComment({
+      comment_id: i.commentId,
+      removed: !i.commentView.comment.removed,
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleDistinguishComment(i: CommentNode) {
+    i.setState({ distinguishLoading: true });
+    i.props.onDistinguishComment({
+      comment_id: i.commentId,
+      distinguished: !i.commentView.comment.distinguished,
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleBanPersonFromCommunity(i: CommentNode) {
+    i.setState({ banLoading: true });
+    i.props.onBanPersonFromCommunity({
+      community_id: i.commentView.community.id,
+      person_id: i.commentView.creator.id,
+      ban: !i.commentView.creator_banned_from_community,
+      reason: i.state.banReason,
+      remove_data: i.state.removeData,
+      expires: futureDaysToUnixTime(i.state.banExpireDays),
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleBanPerson(i: CommentNode) {
+    i.setState({ banLoading: true });
+    i.props.onBanPerson({
+      person_id: i.commentView.creator.id,
+      ban: !i.commentView.creator_banned_from_community,
+      reason: i.state.banReason,
+      remove_data: i.state.removeData,
+      expires: futureDaysToUnixTime(i.state.banExpireDays),
+      auth: myAuthRequired(),
+    });
+  }
+
+  handleModBanBothSubmit(i: CommentNode, event: any) {
+    event.preventDefault();
+    if (i.state.banType == BanType.Community) {
+      i.handleBanPersonFromCommunity(i);
     } else {
-      return "text-muted";
+      i.handleBanPerson(i);
     }
   }
 
-  get pointsTippy(): string {
-    let points = i18n.t("number_of_points", {
-      count: this.state.score,
-      formattedCount: this.state.score,
+  handleAddModToCommunity(i: CommentNode) {
+    i.setState({ addModLoading: true });
+
+    const added = !isMod(i.commentView.comment.creator_id, i.props.moderators);
+    i.props.onAddModToCommunity({
+      community_id: i.commentView.community.id,
+      person_id: i.commentView.creator.id,
+      added,
+      auth: myAuthRequired(),
     });
+  }
 
-    let upvotes = i18n.t("number_of_upvotes", {
-      count: this.state.upvotes,
-      formattedCount: this.state.upvotes,
+  handleAddAdmin(i: CommentNode) {
+    i.setState({ addAdminLoading: true });
+
+    const added = !isAdmin(i.commentView.comment.creator_id, i.props.admins);
+    i.props.onAddAdmin({
+      person_id: i.commentView.creator.id,
+      added,
+      auth: myAuthRequired(),
     });
+  }
 
-    let downvotes = i18n.t("number_of_downvotes", {
-      count: this.state.downvotes,
-      formattedCount: this.state.downvotes,
+  handleTransferCommunity(i: CommentNode) {
+    i.setState({ transferCommunityLoading: true });
+    i.props.onTransferCommunity({
+      community_id: i.commentView.community.id,
+      person_id: i.commentView.creator.id,
+      auth: myAuthRequired(),
     });
+  }
 
-    return `${points} • ${upvotes} • ${downvotes}`;
+  handleReportComment(i: CommentNode, event: any) {
+    event.preventDefault();
+    i.setState({ reportLoading: true });
+    i.props.onCommentReport({
+      comment_id: i.commentId,
+      reason: i.state.reportReason ?? "",
+      auth: myAuthRequired(),
+    });
   }
 
-  get expandText(): string {
-    return this.state.collapsed ? i18n.t("expand") : i18n.t("collapse");
+  handlePurgeBothSubmit(i: CommentNode, event: any) {
+    event.preventDefault();
+    i.setState({ purgeLoading: true });
+
+    if (i.state.purgeType == PurgeType.Person) {
+      i.props.onPurgePerson({
+        person_id: i.commentView.creator.id,
+        reason: i.state.purgeReason,
+        auth: myAuthRequired(),
+      });
+    } else {
+      i.props.onPurgeComment({
+        comment_id: i.commentId,
+        reason: i.state.purgeReason,
+        auth: myAuthRequired(),
+      });
+    }
+  }
+
+  handleFetchChildren(i: CommentNode) {
+    i.setState({ fetchChildrenLoading: true });
+    i.props.onFetchChildren?.({
+      parent_id: i.commentId,
+      max_depth: commentTreeMaxDepth,
+      limit: 999, // TODO
+      type_: "All",
+      saved_only: false,
+      auth: myAuth(),
+    });
   }
 }