From: Dessalines <tyhou13@gmx.com>
Date: Thu, 25 Mar 2021 15:38:37 +0000 (-0400)
Subject: Fix restore scroll position. Fixes #227
X-Git-Url: http://these/git/%22https:/join-lemmy.org/static/%7BcanonicalUrl%7D?a=commitdiff_plain;h=97219bd73bf2620237a947f21768e322d3671724;p=lemmy-ui.git

Fix restore scroll position. Fixes #227
---

diff --git a/src/shared/components/post.tsx b/src/shared/components/post.tsx
index c2ef814..e27a73d 100644
--- a/src/shared/components/post.tsx
+++ b/src/shared/components/post.tsx
@@ -463,7 +463,7 @@ export class Post extends Component<any, PostState> {
       this.fetchCrossPosts();
       this.setState(this.state);
       setupTippy();
-      restoreScrollPosition(this.context);
+      if (!this.state.commentId) restoreScrollPosition(this.context);
     } else if (op == UserOperation.CreateComment) {
       let data = wsJsonToRes<CommentResponse>(msg).data;