Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 879832a

Browse files
authored
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 event
1 parent 3f04e41 commit 879832a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/structures/TimelinePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
11351135
const lastReadEventIndex = this.getLastDisplayedEventIndex({
11361136
ignoreOwn: true,
11371137
});
1138-
const lastReadEvent: MatrixEvent | null = this.state.events[lastReadEventIndex ?? 0] ?? null;
1138+
const lastReadEvent = this.state.events[lastReadEventIndex ?? this.state.events.length - 1] ?? null;
11391139

11401140
const shouldSendReadReceipt = this.shouldSendReadReceipt(
11411141
currentReadReceiptEventId,

0 commit comments

Comments
 (0)