From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:02:28 +0000 (-0400) Subject: set loading state attribute to false if createPost fails (#1311) X-Git-Url: http://these/git/%22%7Burl%7D/%22https:/image.com/%7B%60%24%7BghostArchiveUrl%7D/%7Brss%7D?a=commitdiff_plain;h=64191f2d2104aa5e145ff7f25aef83a983a16f37;p=lemmy-ui.git set loading state attribute to false if createPost fails (#1311) Co-authored-by: Dessalines --- diff --git a/src/shared/components/post/create-post.tsx b/src/shared/components/post/create-post.tsx index 71fac79..c759791 100644 --- a/src/shared/components/post/create-post.tsx +++ b/src/shared/components/post/create-post.tsx @@ -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, + }); } }