You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Getter for last thread reply (#2015)
This commit is contained in:
@@ -105,6 +105,15 @@ export class Thread extends EventEmitter {
|
||||
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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user