Fix threads timeline message ordering (#7968)

This commit is contained in:
Germain 2022-03-03 15:22:16 +00:00 committed by GitHub
parent 75abf03fed
commit acd12c38a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 12 deletions

View file

@ -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;