replace .at(-1) with array.length-1 (#3080) (#3081)

(cherry picked from commit baeb4acddf)

Co-authored-by: Germain <germains@element.io>
This commit is contained in:
ElementRobot
2023-01-20 12:13:36 +00:00
committed by GitHub
parent b8711f15fd
commit cabe14d7e2
+1 -1
View File
@@ -572,7 +572,7 @@ export class Thread extends ReadReceipt<EmittedEvents, EventHandlerMap> {
*/
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