Skip to content

Commit

Permalink
replace .at(-1) with array.length-1 (#3080)
Browse files Browse the repository at this point in the history
(cherry picked from commit baeb4ac)
  • Loading branch information
Germain authored and github-actions[bot] committed Jan 20, 2023
1 parent b8711f1 commit b35ae1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b35ae1e

Please sign in to comment.