From da9af3e72ff1c254de00b6e110c2b101f08eeee1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 28 Jun 2023 16:25:55 +0100 Subject: [PATCH] Fix spurious error sending receipt in thread errors 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 --- src/components/structures/TimelinePanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index d9dfa64493c..061aa9d10e0 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -1135,7 +1135,7 @@ class TimelinePanel extends React.Component { 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,