From 64191f2d2104aa5e145ff7f25aef83a983a16f37 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Fri, 16 Jun 2023 11:02:28 -0400 Subject: [PATCH] set loading state attribute to false if createPost fails (#1311) Co-authored-by: Dessalines --- src/shared/components/post/create-post.tsx | 4 ++++ 1 file changed, 4 insertions(+) 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, + }); } } -- 2.44.1