Fix corrupt thread timeline for sending events (#11260)
Events which are still in the process of being sent should *not* be included in the `EventTimeline`. Doing so means that we will attempt to render them twice, which makes react explode. Fixes https://github.com/vector-im/element-web/issues/25770
This commit is contained in:
parent
cb592dc709
commit
e959eca354
3 changed files with 26 additions and 7 deletions
|
@ -214,7 +214,12 @@ export default class ThreadView extends React.Component<IProps, IState> {
|
|||
let thread = this.props.room.getThread(eventId);
|
||||
|
||||
if (!thread) {
|
||||
thread = this.props.room.createThread(eventId, mxEv, [mxEv], true);
|
||||
const events = [];
|
||||
// if the event is still being sent, don't include it in the Thread yet - otherwise the timeline panel
|
||||
// will attempt to show it twice (once as a regular event, once as a pending event) and everything will
|
||||
// blow up
|
||||
if (mxEv.status === null) events.push(mxEv);
|
||||
thread = this.props.room.createThread(eventId, mxEv, events, true);
|
||||
}
|
||||
|
||||
this.updateThread(thread);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue