]> Untitled Git - lemmy-ui.git/commitdiff
Fixing post setState error. Fixes #902 (#903)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 1 Feb 2023 01:09:51 +0000 (20:09 -0500)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 01:09:51 +0000 (20:09 -0500)
src/shared/components/post/post.tsx

index 637cc927de6bcffa3de451ab28334693b2d21edb..4c44df702c20aa47148bbaa4bef7de3d413893bf 100644 (file)
@@ -161,7 +161,6 @@ export class Post extends Component<any, PostState> {
   }
 
   fetchPost() {
-    this.setState({ commentsRes: undefined, postRes: undefined });
     let auth = myAuth(false);
     let postForm: GetPost = {
       id: this.state.postId,
@@ -498,6 +497,8 @@ export class Post extends Component<any, PostState> {
     i.setState({
       commentSort: CommentSortType[event.target.value],
       commentViewType: CommentViewType.Tree,
+      commentsRes: undefined,
+      postRes: undefined,
     });
     i.fetchPost();
   }