From 46a6a76a41c7845c93c9a7de0332367ca7cdb473 Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Mon, 13 Nov 2023 10:11:27 +0100 Subject: [PATCH] [Backport staging] Ensure `setUserCreator` is called when a store is assigned (#3876) Co-authored-by: R Midhun Suresh --- src/client.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index 0baa52f2134..b496c61330e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1227,7 +1227,7 @@ export class MatrixClient extends TypedEventEmitter(this); public olmVersion: [number, number, number] | null = null; // populated after initCrypto public usingExternalCrypto = false; - public store: Store; + private _store!: Store; public deviceId: string | null; public credentials: { userId: string | null }; @@ -1342,7 +1342,6 @@ export class MatrixClient extends TypedEventEmitter User.createUser(userId, this)); this.deviceId = opts.deviceId || null; this.sessionId = randomString(10); @@ -1507,6 +1506,15 @@ export class MatrixClient extends TypedEventEmitter User.createUser(userId, this)); + } + + public get store(): Store { + return this._store; + } + /** * High level helper method to begin syncing and poll for new events. To listen for these * events, add a listener for {@link ClientEvent.Event}