From 214c1d3fd1625d018c1a8e0660c57d7850617542 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 7 Feb 2020 10:12:05 -0500 Subject: [PATCH] Fix issue with post creating redirecting other posts. Fixes #520 --- ui/src/components/post-form.tsx | 12 ++++++++---- 1 file 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 { 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; -- 2.44.1