mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Resolve promise on all code paths
This commit is contained in:
parent
4bed52aa58
commit
2ef934c39d
@ -562,6 +562,7 @@ export class BaseRoom extends EventEmitter {
|
|||||||
* We only return the timeline when it has completely loaded!
|
* We only return the timeline when it has completely loaded!
|
||||||
*/
|
*/
|
||||||
log.log({ l: "Returning existing timeline" });
|
log.log({ l: "Returning existing timeline" });
|
||||||
|
resolve();
|
||||||
return this._timeline;
|
return this._timeline;
|
||||||
}
|
}
|
||||||
this._timeline = new Timeline({
|
this._timeline = new Timeline({
|
||||||
@ -585,11 +586,12 @@ export class BaseRoom extends EventEmitter {
|
|||||||
this._timeline.enableEncryption(this._decryptEntries.bind(this, DecryptionSource.Timeline));
|
this._timeline.enableEncryption(this._decryptEntries.bind(this, DecryptionSource.Timeline));
|
||||||
}
|
}
|
||||||
await this._timeline.load(this._user, this.membership, log);
|
await this._timeline.load(this._user, this.membership, log);
|
||||||
resolve();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// this also clears this._timeline in the closeCallback
|
// this also clears this._timeline in the closeCallback
|
||||||
this._timeline.dispose();
|
this._timeline.dispose();
|
||||||
throw err;
|
throw err;
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
}
|
}
|
||||||
return this._timeline;
|
return this._timeline;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user