From 5b2e12ca0c026564c6dd5f37d16e475595c894dd Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 20 Mar 2023 10:58:53 -0500 Subject: [PATCH] Refactor custom logic to use the shared canResetTimeline() (#10403) 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 5ebab7c0a0..b496454c7e 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(); } };