mirror of https://github.com/vector-im/riot-web
Fix spurious error sending receipt in thread errors (#11157)
Trying to send an RR to the first event fails in threads as that event is a thread root and cannot carry a threaded RR so instead target the last eventpull/28788/head^2
parent
3f04e41c21
commit
879832a4eb
|
@ -1135,7 +1135,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
|
||||||
const lastReadEventIndex = this.getLastDisplayedEventIndex({
|
const lastReadEventIndex = this.getLastDisplayedEventIndex({
|
||||||
ignoreOwn: true,
|
ignoreOwn: true,
|
||||||
});
|
});
|
||||||
const lastReadEvent: MatrixEvent | null = this.state.events[lastReadEventIndex ?? 0] ?? null;
|
const lastReadEvent = this.state.events[lastReadEventIndex ?? this.state.events.length - 1] ?? null;
|
||||||
|
|
||||||
const shouldSendReadReceipt = this.shouldSendReadReceipt(
|
const shouldSendReadReceipt = this.shouldSendReadReceipt(
|
||||||
currentReadReceiptEventId,
|
currentReadReceiptEventId,
|
||||||
|
|
Loading…
Reference in New Issue