aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'FrontEnd/src/app/views')
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx4
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx11
2 files changed, 5 insertions, 10 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
index 704e51fb..1c8873f9 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
@@ -10,6 +10,8 @@ import { getAlertHost } from "@/services/alert";
import Timeline from "./Timeline";
import TimelinePostEdit from "./TimelinePostEdit";
+import useReverseScrollPositionRemember from "@/utilities/useReverseScrollPositionRemember";
+
export interface TimelinePageCardProps {
timeline: HttpTimelineInfo;
collapse: boolean;
@@ -35,6 +37,8 @@ const TimelinePageTemplate: React.FC<TimelinePageTemplateProps> = (props) => {
HttpTimelineInfo | "loading" | "offline" | "notexist" | "error"
>("loading");
+ useReverseScrollPositionRemember();
+
React.useEffect(() => {
setTimeline("loading");
}, [timelineName]);
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx
index b91357dd..e0534695 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx
@@ -1,6 +1,7 @@
import React from "react";
import { HttpTimelinePostInfo } from "@/http/timeline";
+
import TimelinePostListView from "./TimelinePostListView";
export interface TimelinePagedPostListViewProps {
@@ -38,16 +39,6 @@ const TimelinePagedPostListView: React.FC<TimelinePagedPostListViewProps> = (
}
}, [lastViewCount, posts]);
- React.useEffect(() => {
- if (lastViewCount !== 10) {
- document
- .getElementById(
- `timeline-post-${posts[posts.length - (lastViewCount - 10)].id}`
- )
- ?.scrollIntoView(true);
- }
- }, [lastViewCount, posts]);
-
return (
<TimelinePostListView
className={className}