From: Dessalines Date: Fri, 7 Feb 2020 15:12:05 +0000 (-0500) Subject: Fix issue with post creating redirecting other posts. Fixes #520 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%7BmarkdownHelpUrl%7D?a=commitdiff_plain;h=214c1d3fd1625d018c1a8e0660c57d7850617542;p=lemmy.git Fix issue with post creating redirecting other posts. Fixes #520 --- 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;