X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fcommunity%2Fcommunity.tsx;h=b88d6f6100e03843ef387ad60a3c8d524a0b1650;hb=53c3cfeade90150b07431386745a24aa699a25ec;hp=7eefe0eb96ea0c8a2932e5b9f94d0bef371adf1f;hpb=cf857b4eca694b530f559a5ad054e6b3a9db5c79;p=lemmy-ui.git diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 7eefe0e..b88d6f6 100644 --- a/src/shared/components/community/community.tsx +++ b/src/shared/components/community/community.tsx @@ -15,7 +15,6 @@ import { updateCommunityBlock, updatePersonBlock, } from "@utils/app"; -import { restoreScrollPosition, saveScrollPosition } from "@utils/browser"; import { getPageFromString, getQueryParams, @@ -23,7 +22,7 @@ import { } from "@utils/helpers"; import type { QueryParams } from "@utils/types"; import { RouteDataResponse } from "@utils/types"; -import { Component, linkEvent } from "inferno"; +import { Component, RefObject, createRef, linkEvent } from "inferno"; import { RouteComponentProps } from "inferno-router/dist/Route"; import { AddAdmin, @@ -155,7 +154,7 @@ export class Community extends Component< finished: new Map(), isIsomorphic: false, }; - + private readonly mainContentRef: RefObject; constructor(props: RouteComponentProps<{ name: string }>, context: any) { super(props, context); @@ -196,7 +195,7 @@ export class Community extends Component< this.handleSavePost = this.handleSavePost.bind(this); this.handlePurgePost = this.handlePurgePost.bind(this); this.handleFeaturePost = this.handleFeaturePost.bind(this); - + this.mainContentRef = createRef(); // Only fetch the data if coming from another route if (FirstLoadService.isFirstLoad) { const { communityRes, commentsRes, postsRes } = this.isoData.routeData; @@ -229,10 +228,6 @@ export class Community extends Component< setupTippy(); } - componentWillUnmount() { - saveScrollPosition(this.context); - } - static async fetchInitialData({ client, path, @@ -317,12 +312,16 @@ export class Community extends Component<
-
+
{this.communityInfo(res)}
-
+
+
+
); @@ -487,7 +486,7 @@ export class Community extends Component< community && (
-
{community.title}
+

{community.title}