diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 63aece42..87a3150c 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -237,6 +237,10 @@ export class Session { return this._sessionBackup; } + get hasIdentity() { + return !!this._e2eeAccount; + } + /** @internal */ async createIdentity(log) { if (this._olm) { diff --git a/src/matrix/SessionContainer.js b/src/matrix/SessionContainer.js index 7248e11e..479bb7a8 100644 --- a/src/matrix/SessionContainer.js +++ b/src/matrix/SessionContainer.js @@ -233,8 +233,7 @@ export class SessionContainer { platform: this._platform, }); await this._session.load(log); - // TODO: check instead storage doesn't have an identity - if (isNewLogin) { + if (!this._session.hasIdentity) { this._status.set(LoadStatus.SessionSetup); await log.wrap("createIdentity", log => this._session.createIdentity(log)); }