diff --git a/src/models/room.ts b/src/models/room.ts index 7e1284b4e9b..f4d693bfdd5 100644 --- a/src/models/room.ts +++ b/src/models/room.ts @@ -398,7 +398,8 @@ export class Room extends ReadReceipt { * Use getLiveTimeline().getState(EventTimeline.FORWARDS) instead. */ public currentState!: RoomState; - public readonly relations = new RelationsContainer(this.client, this); + + public readonly relations; /** * A collection of events known by the client @@ -460,6 +461,7 @@ export class Room extends ReadReceipt { private readonly opts: IOpts = {}, ) { super(); + // In some cases, we add listeners for every displayed Matrix event, so it's // common to have quite a few more than the default limit. this.setMaxListeners(100); @@ -470,6 +472,8 @@ export class Room extends ReadReceipt { this.name = roomId; this.normalizedName = roomId; + this.relations = new RelationsContainer(this.client, this); + // Listen to our own receipt event as a more modular way of processing our own // receipts. No need to remove the listener: it's on ourself anyway. this.on(RoomEvent.Receipt, this.onReceipt); diff --git a/tsconfig.json b/tsconfig.json index c1c9d48b8e9..a7d2eeb4dd4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2016", + "target": "es2022", "experimentalDecorators": true, "esModuleInterop": true, "module": "commonjs",