Improve thread partitioning for 2nd degree relations (#7748)
This commit is contained in:
parent
87ca70edb1
commit
15a9303d29
6 changed files with 56 additions and 17 deletions
|
@ -1285,11 +1285,30 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
|||
// should use this list, so that they don't advance into pending events.
|
||||
const liveEvents = [...events];
|
||||
|
||||
const thread = events[0]?.getThread();
|
||||
|
||||
// if we're at the end of the live timeline, append the pending events
|
||||
if (!this.timelineWindow.canPaginate(EventTimeline.FORWARDS)) {
|
||||
events.push(...this.props.timelineSet.getPendingEvents(thread));
|
||||
const pendingEvents = this.props.timelineSet.getPendingEvents();
|
||||
if (this.context.timelineRenderingType === TimelineRenderingType.Thread) {
|
||||
events.push(...pendingEvents.filter(e => e.threadRootId === this.context.threadId));
|
||||
} else {
|
||||
events.push(...pendingEvents.filter(e => {
|
||||
const hasNoRelation = !e.getRelation();
|
||||
if (hasNoRelation) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (e.isThreadRelation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const parentEvent = this.props.timelineSet.findEventById(e.getAssociatedId());
|
||||
if (!parentEvent) {
|
||||
return false;
|
||||
} else {
|
||||
return !parentEvent.isThreadRelation;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue