Fix threads timeline message ordering (#7968)
This commit is contained in:
parent
75abf03fed
commit
acd12c38a9
3 changed files with 36 additions and 12 deletions
|
@ -27,6 +27,7 @@ import { RoomMember, RoomMemberEvent } from 'matrix-js-sdk/src/models/room-membe
|
|||
import { debounce } from 'lodash';
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { ClientEvent } from "matrix-js-sdk/src/client";
|
||||
import { Thread } from 'matrix-js-sdk/src/models/thread';
|
||||
|
||||
import SettingsStore from "../../settings/SettingsStore";
|
||||
import { Layout } from "../../settings/enums/Layout";
|
||||
|
@ -540,6 +541,21 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
|||
// ignore events for other timeline sets
|
||||
if (data.timeline.getTimelineSet() !== this.props.timelineSet) return;
|
||||
|
||||
if (!Thread.hasServerSideSupport && this.context.timelineRenderingType === TimelineRenderingType.Thread) {
|
||||
// const direction = toStartOfTimeline ? Direction.Backward : Direction.Forward;
|
||||
// this.timelineWindow.extend(direction, 1);
|
||||
if (toStartOfTimeline && !this.state.canBackPaginate) {
|
||||
this.setState({
|
||||
canBackPaginate: true,
|
||||
});
|
||||
}
|
||||
if (!toStartOfTimeline && !this.state.canForwardPaginate) {
|
||||
this.setState({
|
||||
canForwardPaginate: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ignore anything but real-time updates at the end of the room:
|
||||
// updates from pagination will happen when the paginate completes.
|
||||
if (toStartOfTimeline || !data || !data.liveEvent) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue