Skip to content

Commit b35ae1e

Browse files
Germaingithub-actions[bot]
Germain
authored andcommitted
replace .at(-1) with array.length-1 (#3080)
(cherry picked from commit baeb4ac)
1 parent b8711f1 commit b35ae1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/models/thread.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ export class Thread extends ReadReceipt<EmittedEvents, EventHandlerMap> {
572572
*/
573573
public getEventReadUpTo(userId: string, ignoreSynthesized?: boolean): string | null {
574574
const isCurrentUser = userId === this.client.getUserId();
575-
const lastReply = this.timeline.at(-1);
575+
const lastReply = this.timeline[this.timeline.length - 1];
576576
if (isCurrentUser && lastReply) {
577577
// If the last activity in a thread is prior to the first threaded read receipt
578578
// sent in the room (suggesting that it was sent before the user started

0 commit comments

Comments
 (0)