Merge pull request #6146 from robintown/fix-jump-to-bottom
Fix jumping to bottom without a highlighted eventpull/21833/head
commit
00dd6e878f
|
@ -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
|
// jump down to the bottom of this room, where new events are arriving
|
||||||
private jumpToLiveTimeline = () => {
|
private jumpToLiveTimeline = () => {
|
||||||
dis.dispatch({
|
if (this.state.initialEventId && this.state.isInitialEventHighlighted) {
|
||||||
action: 'view_room',
|
// If we were viewing a highlighted event, firing view_room without
|
||||||
room_id: this.state.room.roomId,
|
// 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
|
// jump up to wherever our read marker is
|
||||||
|
|
Loading…
Reference in New Issue