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

Commit

Permalink
Merge pull request #6146 from robintown/fix-jump-to-bottom
Browse files Browse the repository at this point in the history
Fix jumping to bottom without a highlighted event
  • Loading branch information
germain-gg authored Jun 7, 2021
2 parents abfe6d8 + b06da16 commit 00dd6e8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1526,10 +1526,19 @@ export default class RoomView extends React.Component<IProps, IState> {

// jump down to the bottom of this room, where new events are arriving
private jumpToLiveTimeline = () => {
dis.dispatch({
action: 'view_room',
room_id: this.state.room.roomId,
});
if (this.state.initialEventId && this.state.isInitialEventHighlighted) {
// If we were viewing a highlighted event, firing view_room without
// an event will take care of both clearing the URL fragment and
// jumping to the bottom
dis.dispatch({
action: 'view_room',
room_id: this.state.room.roomId,
});
} else {
// Otherwise we have to jump manually
this.messagePanel.jumpToLiveTimeline();
dis.fire(Action.FocusComposer);
}
};

// jump up to wherever our read marker is
Expand Down

0 comments on commit 00dd6e8

Please sign in to comment.