From 5de39ca39d973e4bba47f0d73982b79d10d469fc Mon Sep 17 00:00:00 2001 From: Luna <46259660+LunaticHacker@users.noreply.github.com> Date: Sun, 3 Oct 2021 21:48:10 +0530 Subject: [PATCH] hide mod actions appropriately fix #441 (#447) Thx! --- src/shared/components/comment/comment-node.tsx | 9 ++++++--- src/shared/components/post/post-listing.tsx | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 6c6ba32..8f831ce 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -1111,7 +1111,8 @@ export class CommentNode extends Component { } handleModRemoveShow(i: CommentNode) { - i.state.showRemoveDialog = true; + i.state.showRemoveDialog = !i.state.showRemoveDialog; + i.state.showBanDialog = false; i.setState(i.state); } @@ -1167,14 +1168,16 @@ export class CommentNode extends Component { } handleModBanFromCommunityShow(i: CommentNode) { - i.state.showBanDialog = !i.state.showBanDialog; + i.state.showBanDialog = true; i.state.banType = BanType.Community; + i.state.showRemoveDialog = false; i.setState(i.state); } handleModBanShow(i: CommentNode) { - i.state.showBanDialog = !i.state.showBanDialog; + i.state.showBanDialog = true; i.state.banType = BanType.Site; + i.state.showRemoveDialog = false; i.setState(i.state); } diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index d61c690..6c8b0e3 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -1425,7 +1425,8 @@ export class PostListing extends Component { } handleModRemoveShow(i: PostListing) { - i.state.showRemoveDialog = true; + i.state.showRemoveDialog = !i.state.showRemoveDialog; + i.state.showBanDialog = false; i.setState(i.state); } @@ -1474,12 +1475,14 @@ export class PostListing extends Component { handleModBanFromCommunityShow(i: PostListing) { i.state.showBanDialog = true; i.state.banType = BanType.Community; + i.state.showRemoveDialog = false; i.setState(i.state); } handleModBanShow(i: PostListing) { i.state.showBanDialog = true; i.state.banType = BanType.Site; + i.state.showRemoveDialog = false; i.setState(i.state); } -- 2.44.1