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

Commit

Permalink
Fix spurious error sending receipt in thread errors (#11157)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
t3chguy authored Jun 29, 2023
1 parent 3f04e41 commit 879832a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/structures/TimelinePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
const lastReadEventIndex = this.getLastDisplayedEventIndex({
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(
currentReadReceiptEventId,
Expand Down

0 comments on commit 879832a

Please sign in to comment.