]> Untitled Git - lemmy-ui.git/commitdiff
set loading state attribute to false if createPost fails (#1311)
authorAlec Armbruster <35377827+alectrocute@users.noreply.github.com>
Fri, 16 Jun 2023 15:02:28 +0000 (11:02 -0400)
committerGitHub <noreply@github.com>
Fri, 16 Jun 2023 15:02:28 +0000 (11:02 -0400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
src/shared/components/post/create-post.tsx

index 71fac79aed8668bc9f694df463ee884628eb8419..c7597917740486cd58eae285e54232887737b893 100644 (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,
+      });
     }
   }