1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Getter for last thread reply (#2015)

This commit is contained in:
Germain
2021-11-09 14:46:48 +00:00
committed by GitHub
parent 1dc899ba6e
commit b07d44a6c0

View File

@@ -105,6 +105,15 @@ export class Thread extends EventEmitter {
return this.timelineSet.findEventById(eventId); return this.timelineSet.findEventById(eventId);
} }
/**
* Return last reply to the thread
*/
public get lastReply(): MatrixEvent {
const threadReplies = this.events
.filter(event => event.isThreadRelation);
return threadReplies[threadReplies.length - 1];
}
/** /**
* Determines thread's ready status * Determines thread's ready status
*/ */