From cabe14d7e28cefbc15b46f5e9fc56be7ee67904e Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Fri, 20 Jan 2023 12:13:36 +0000 Subject: [PATCH] replace .at(-1) with array.length-1 (#3080) (#3081) (cherry picked from commit baeb4acddf718eea7e286761a5c9ee5136993a88) Co-authored-by: Germain --- src/models/thread.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/thread.ts b/src/models/thread.ts index 31587bbaf..b688d12ac 100644 --- a/src/models/thread.ts +++ b/src/models/thread.ts @@ -572,7 +572,7 @@ export class Thread extends ReadReceipt { */ public getEventReadUpTo(userId: string, ignoreSynthesized?: boolean): string | null { const isCurrentUser = userId === this.client.getUserId(); - const lastReply = this.timeline.at(-1); + const lastReply = this.timeline[this.timeline.length - 1]; if (isCurrentUser && lastReply) { // If the last activity in a thread is prior to the first threaded read receipt // sent in the room (suggesting that it was sent before the user started