Fix race conditions around threads (#8448)

This commit is contained in:
Michael Telatynski
2022-05-03 14:25:08 +01:00
committed by GitHub
parent 1aaaad2f32
commit f29ef04751
8 changed files with 37 additions and 67 deletions

View File

@@ -31,10 +31,8 @@ export class ThreadsRoomNotificationState extends NotificationState implements I
constructor(public readonly room: Room) {
super();
if (this.room?.threads) {
for (const [, thread] of this.room.threads) {
this.onNewThread(thread);
}
for (const thread of this.room.getThreads()) {
this.onNewThread(thread);
}
this.room.on(ThreadEvent.New, this.onNewThread);
}