summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-09-05 17:18:48 -0700
committerDessalines <tyhou13@gmx.com>2019-09-05 17:18:48 -0700
commit565fc0abdb3857390fb61cfcfeffa6fa0378ed6f (patch)
tree44c07b15d8501167ce359a6f7cf180c2acab2462 /ui/src/components/post.tsx
parentbeea10454bb59ef3795fc92c994cab3557e90fee (diff)
Adding ability to do mod action on post creator
- Fixes #248 - Show banned on user comment and user overview. Fixes #264
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index 91f8f4db..7e2dbd62 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -351,6 +351,9 @@ export class Post extends Component<any, PostState> {
let res: BanFromCommunityResponse = msg;
this.state.comments.filter(c => c.creator_id == res.user.id)
.forEach(c => c.banned_from_community = res.banned);
+ if (this.state.post.creator_id == res.user.id) {
+ this.state.post.banned_from_community = res.banned;
+ }
this.setState(this.state);
} else if (op == UserOperation.AddModToCommunity) {
let res: AddModToCommunityResponse = msg;
@@ -360,6 +363,9 @@ export class Post extends Component<any, PostState> {
let res: BanUserResponse = msg;
this.state.comments.filter(c => c.creator_id == res.user.id)
.forEach(c => c.banned = res.banned);
+ if (this.state.post.creator_id == res.user.id) {
+ this.state.post.banned = res.banned;
+ }
this.setState(this.state);
} else if (op == UserOperation.AddAdmin) {
let res: AddAdminResponse = msg;