Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Refactor custom logic to use the shared canResetTimeline() function #10403

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/structures/TimelinePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
private onRoomTimelineReset = (room: Room, timelineSet: EventTimelineSet): void => {
if (timelineSet !== this.props.timelineSet) return;

if (this.messagePanel.current && this.messagePanel.current.isAtBottom()) {
if (this.canResetTimeline()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is equivalent to before:

public canResetTimeline = (): boolean => this.messagePanel?.current?.isAtBottom();

this.loadTimeline();
}
};
Expand Down