From: Dessalines Date: Wed, 1 Feb 2023 01:09:51 +0000 (-0500) Subject: Fixing post setState error. Fixes #902 (#903) X-Git-Url: http://these/git/ui/assets/static/README.zh.hans.md?a=commitdiff_plain;h=87c30705eff0c11caba2ae12c239cc390e3e5c4e;p=lemmy-ui.git Fixing post setState error. Fixes #902 (#903) --- diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 637cc92..4c44df7 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -161,7 +161,6 @@ export class Post extends Component { } 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 { i.setState({ commentSort: CommentSortType[event.target.value], commentViewType: CommentViewType.Tree, + commentsRes: undefined, + postRes: undefined, }); i.fetchPost(); }