Skip to content

Commit 4f4811e

Browse files
authored
Emit thread update after event decryption (#2040)
1 parent db9936e commit 4f4811e

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/models/room.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ export class Room extends EventEmitter {
17481748
// types X Y Z to the timeline".
17491749
this.addLiveEvent(events[i], duplicateStrategy, fromCache);
17501750
const thread = this.threads.get(events[i].getId());
1751-
if (thread && !thread.ready) {
1751+
if (thread) {
17521752
thread.addEvent(events[i], true);
17531753
}
17541754
}

src/models/thread.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
107107
this._currentUserParticipated = true;
108108
}
109109

110-
if (this.ready) {
111-
this.client.decryptEventIfNeeded(event, {});
112-
}
110+
await this.client.decryptEventIfNeeded(event, {});
113111
this.emit(ThreadEvent.Update, this);
114112
}
115113

@@ -129,13 +127,6 @@ export class Thread extends TypedEventEmitter<ThreadEvent> {
129127
return threadReplies[threadReplies.length - 1];
130128
}
131129

132-
/**
133-
* Determines thread's ready status
134-
*/
135-
public get ready(): boolean {
136-
return this.rootEvent !== undefined;
137-
}
138-
139130
/**
140131
* The thread ID, which is the same as the root event ID
141132
*/

0 commit comments

Comments
 (0)