From: Luna <46259660+LunaticHacker@users.noreply.github.com> Date: Sun, 3 Oct 2021 16:18:10 +0000 (+0530) Subject: hide mod actions appropriately fix #441 (#447) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/README.md?a=commitdiff_plain;h=5de39ca39d973e4bba47f0d73982b79d10d469fc;p=lemmy-ui.git hide mod actions appropriately fix #441 (#447) Thx! --- 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); }