You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
Emit thread update after event decryption (#2040)
This commit is contained in:
@@ -1748,7 +1748,7 @@ export class Room extends EventEmitter {
|
||||
// types X Y Z to the timeline".
|
||||
this.addLiveEvent(events[i], duplicateStrategy, fromCache);
|
||||
const thread = this.threads.get(events[i].getId());
|
||||
if (thread && !thread.ready) {
|
||||
if (thread) {
|
||||
thread.addEvent(events[i], true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,9 +107,7 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
|
||||
this._currentUserParticipated = true;
|
||||
}
|
||||
|
||||
if (this.ready) {
|
||||
this.client.decryptEventIfNeeded(event, {});
|
||||
}
|
||||
await this.client.decryptEventIfNeeded(event, {});
|
||||
this.emit(ThreadEvent.Update, this);
|
||||
}
|
||||
|
||||
@@ -129,13 +127,6 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
|
||||
return threadReplies[threadReplies.length - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines thread's ready status
|
||||
*/
|
||||
public get ready(): boolean {
|
||||
return this.rootEvent !== undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The thread ID, which is the same as the root event ID
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user