Skip to content

Commit

Permalink
hide mod actions appropriately fix #441 (#447)
Browse files Browse the repository at this point in the history
Thx!
  • Loading branch information
LunaticHacker authored Oct 3, 2021
1 parent 0b3d7fb commit 5de39ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/shared/components/comment/comment-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
5 changes: 4 additions & 1 deletion src/shared/components/post/post-listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 5de39ca

Please sign in to comment.