await the room log operations for login/load session

so the callee can await the operation
This commit is contained in:
Bruno Windels 2021-02-24 09:58:50 +01:00
parent 113b47540a
commit 86011b42e3

View File

@ -73,7 +73,7 @@ export class SessionContainer {
return; return;
} }
this._status.set(LoadStatus.Loading); this._status.set(LoadStatus.Loading);
this._platform.logger.run("load session", async log => { await this._platform.logger.run("load session", async log => {
log.set("id", sessionId); log.set("id", sessionId);
try { try {
const sessionInfo = await this._platform.sessionInfoStorage.get(sessionId); const sessionInfo = await this._platform.sessionInfoStorage.get(sessionId);
@ -94,7 +94,7 @@ export class SessionContainer {
if (this._status.get() !== LoadStatus.NotLoading) { if (this._status.get() !== LoadStatus.NotLoading) {
return; return;
} }
this._platform.logger.run("login", async log => { await this._platform.logger.run("login", async log => {
this._status.set(LoadStatus.Login); this._status.set(LoadStatus.Login);
const clock = this._platform.clock; const clock = this._platform.clock;
let sessionInfo; let sessionInfo;