]> Untitled Git - lemmy-ui.git/commitdiff
hide mod actions appropriately fix #441 (#447)
authorLuna <46259660+LunaticHacker@users.noreply.github.com>
Sun, 3 Oct 2021 16:18:10 +0000 (21:48 +0530)
committerGitHub <noreply@github.com>
Sun, 3 Oct 2021 16:18:10 +0000 (12:18 -0400)
Thx!

src/shared/components/comment/comment-node.tsx
src/shared/components/post/post-listing.tsx

index 6c6ba32ca30056ff655ed25053b706a316f50060..8f831ce400f71e3ee93739a57b31a0b47af1bf5d 100644 (file)
@@ -1111,7 +1111,8 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
   }
 
   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<CommentNodeProps, CommentNodeState> {
   }
 
   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);
   }
 
index d61c690bd5c1e96642896623dbd88c01a77ea1b3..6c8b0e34fba407e46ab4530cc5b9eb6d7d992d99 100644 (file)
@@ -1425,7 +1425,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
   }
 
   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<PostListingProps, PostListingState> {
   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);
   }