forked from mystiq/hydrogen-web
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;
|
return this._sessionBackup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasIdentity() {
|
||||||
|
return !!this._e2eeAccount;
|
||||||
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
async createIdentity(log) {
|
async createIdentity(log) {
|
||||||
if (this._olm) {
|
if (this._olm) {
|
||||||
|
|
|
@ -233,8 +233,7 @@ export class SessionContainer {
|
||||||
platform: this._platform,
|
platform: this._platform,
|
||||||
});
|
});
|
||||||
await this._session.load(log);
|
await this._session.load(log);
|
||||||
// TODO: check instead storage doesn't have an identity
|
if (!this._session.hasIdentity) {
|
||||||
if (isNewLogin) {
|
|
||||||
this._status.set(LoadStatus.SessionSetup);
|
this._status.set(LoadStatus.SessionSetup);
|
||||||
await log.wrap("createIdentity", log => this._session.createIdentity(log));
|
await log.wrap("createIdentity", log => this._session.createIdentity(log));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue