set loading state attribute to false if createPost fails (#1311)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
Alec Armbruster 2023-06-16 11:02:28 -04:00 committed by GitHub
parent 1c26a85fff
commit 64191f2d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
});
}
}