From b32ba26780e1c98196cfdb4b72cc409e07e79062 Mon Sep 17 00:00:00 2001 From: Alec Armbruster Date: Thu, 15 Jun 2023 14:28:38 -0400 Subject: [PATCH] set loading state attribute to false if createPost fails --- 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 71fac79ae..c75979177 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, + }); } }