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/readmes/%24%7Bsubmission.url%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, + }); } }