create e2ee identity also when storage got cleared without backup
This commit is contained in:
parent
a1c66738db
commit
e0b9a3fa50
2 changed files with 5 additions and 2 deletions
|
@ -237,6 +237,10 @@ export class Session {
|
|||
return this._sessionBackup;
|
||||
}
|
||||
|
||||
get hasIdentity() {
|
||||
return !!this._e2eeAccount;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
async createIdentity(log) {
|
||||
if (this._olm) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Reference in a new issue