From 4aa248c53ce2f90af067ac9a12beed38425d2772 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Fri, 17 Mar 2023 15:36:38 -0500 Subject: [PATCH] Refactor custom logic to use the shared canResetTimeline() Split out from https://github.com/matrix-org/matrix-react-sdk/pull/8354#discussion_r852611407 --- src/components/structures/TimelinePanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 5ebab7c0a0e..b496454c7ee 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -773,7 +773,7 @@ class TimelinePanel extends React.Component { private onRoomTimelineReset = (room: Room, timelineSet: EventTimelineSet): void => { if (timelineSet !== this.props.timelineSet) return; - if (this.messagePanel.current && this.messagePanel.current.isAtBottom()) { + if (this.canResetTimeline()) { this.loadTimeline(); } };