mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-22 19:01:26 +00:00
set loading state attribute to false if createPost fails (#1311)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
1c26a85fff
commit
64191f2d21
1 changed files with 4 additions and 0 deletions
|
@ -224,6 +224,10 @@ export class CreatePost extends Component<
|
|||
if (res.state === "success") {
|
||||
const postId = res.data.post_view.post.id;
|
||||
this.props.history.replace(`/post/${postId}`);
|
||||
} else {
|
||||
this.setState({
|
||||
loading: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue