mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-05 20:15:01 +00:00
Fix issue with post creating redirecting other posts. Fixes #520
This commit is contained in:
parent
1c182e381b
commit
68ac96147c
1 changed files with 8 additions and 4 deletions
12
ui/src/components/post-form.tsx
vendored
12
ui/src/components/post-form.tsx
vendored
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue