diff options
author | crupest <crupest@outlook.com> | 2021-05-13 16:15:10 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-13 16:15:10 +0800 |
commit | 27a30de84b6240d9a4d407796bf44c4fc3f6b01f (patch) | |
tree | 237bbd48bd98055c0b0e7c7910347ae288b695f1 /FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx | |
parent | 26d03049dbf9fcdee29415a1b7d5ddd7fbe1914f (diff) | |
download | timeline-27a30de84b6240d9a4d407796bf44c4fc3f6b01f.tar.gz timeline-27a30de84b6240d9a4d407796bf44c4fc3f6b01f.tar.bz2 timeline-27a30de84b6240d9a4d407796bf44c4fc3f6b01f.zip |
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx')
-rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx index 9c43434d..69fd9207 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelinePagedPostListView.tsx @@ -3,11 +3,6 @@ import { fromEvent } from "rxjs"; import { HttpTimelinePostInfo } from "@/http/timeline"; -import { - getReverseScrollPosition, - scrollToReverseScrollPosition, -} from "@/utilities/useReverseScrollPositionRemember"; - import TimelinePostListView from "./TimelinePostListView"; export interface TimelinePagedPostListViewProps { @@ -30,18 +25,10 @@ const TimelinePagedPostListView: React.FC<TimelinePagedPostListViewProps> = ( : posts.slice(-lastViewCount); }, [posts, lastViewCount]); - const lastScrollPosition = React.useRef<number | null>(null); - React.useEffect(() => { - if (lastScrollPosition.current != null) { - scrollToReverseScrollPosition(lastScrollPosition.current); - lastScrollPosition.current = null; - } - if (lastViewCount < posts.length) { const subscription = fromEvent(window, "scroll").subscribe(() => { if (window.scrollY === 0) { - lastScrollPosition.current = getReverseScrollPosition(); setLastViewCount(lastViewCount + 10); } }); |