diff --git a/src/matrix/room/BaseRoom.js b/src/matrix/room/BaseRoom.js index 7f5992ee..bcb8141f 100644 --- a/src/matrix/room/BaseRoom.js +++ b/src/matrix/room/BaseRoom.js @@ -414,11 +414,14 @@ export class BaseRoom extends EventEmitter { } async observePowerLevels() { + if (this._powerLevelLoading) { await this._powerLevelLoading; } let observable = this._powerLevels; if (!observable) { - const powerLevels = await this._loadPowerLevels(); + this._powerLevelLoading = this._loadPowerLevels(); + const powerLevels = await this._powerLevelLoading; observable = new RetainedObservableValue(powerLevels, () => { this._powerLevels = null; }); this._powerLevels = observable; + this._powerLevelLoading = null; } return observable; }