summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-form.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-07 10:12:05 -0500
committerDessalines <tyhou13@gmx.com>2020-02-07 10:12:05 -0500
commit214c1d3fd1625d018c1a8e0660c57d7850617542 (patch)
tree1406d1c48168ec777cfd88c8976a532023db10ee /ui/src/components/post-form.tsx
parentbe77e30110953fed0a8ada4c35b8e2cfde09d7e1 (diff)
Fix issue with post creating redirecting other posts. Fixes #520
Diffstat (limited to 'ui/src/components/post-form.tsx')
-rw-r--r--ui/src/components/post-form.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx
index 35d4e595..7984c2a8 100644
--- a/ui/src/components/post-form.tsx
+++ b/ui/src/components/post-form.tsx
@@ -516,12 +516,16 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
this.setState(this.state);
} else if (res.op == UserOperation.CreatePost) {
let data = res.data as PostResponse;
- this.state.loading = false;
- this.props.onCreate(data.post.id);
+ if (data.post.creator_id == UserService.Instance.user.id) {
+ this.state.loading = false;
+ this.props.onCreate(data.post.id);
+ }
} else if (res.op == UserOperation.EditPost) {
let data = res.data as PostResponse;
- this.state.loading = false;
- this.props.onEdit(data.post);
+ if (data.post.creator_id == UserService.Instance.user.id) {
+ this.state.loading = false;
+ this.props.onEdit(data.post);
+ }
} else if (res.op == UserOperation.Search) {
let data = res.data as SearchResponse;