Force refresh threads timeline

Fixes vector-im/element-web#18947

In the absence of a proper pending events / remote echo setup it seems fairly difficult to get the timeline to update

Adding a temporary helper to force refresh the timeline and not swallow local events when sending a message from the thread sidebar
This commit is contained in:
Germain Souquet 2021-09-09 17:31:05 +01:00
parent 8cf891f9a4
commit 672dab1998
2 changed files with 14 additions and 3 deletions

View file

@ -1179,6 +1179,12 @@ class TimelinePanel extends React.Component<IProps, IState> {
this.setState(this.getEvents());
}
// Force refresh the timeline before threads support pending events
public refreshTimeline(): void {
this.loadTimeline();
this.reloadEvents();
}
// get the list of events from the timeline window and the pending event list
private getEvents(): Pick<IState, "events" | "liveEvents" | "firstVisibleEventIndex"> {
const events: MatrixEvent[] = this.timelineWindow.getEvents();