forked from mystiq/hydrogen-web
don't leak timeline when an error is thrown while opening it
or you are just stuck with "not dealing with race" errors until refresh
This commit is contained in:
parent
0c4c018ceb
commit
d965d57be7
1 changed files with 9 additions and 3 deletions
|
@ -404,10 +404,16 @@ export class BaseRoom extends EventEmitter {
|
||||||
clock: this._platform.clock,
|
clock: this._platform.clock,
|
||||||
logger: this._platform.logger,
|
logger: this._platform.logger,
|
||||||
});
|
});
|
||||||
if (this._roomEncryption) {
|
try {
|
||||||
this._timeline.enableEncryption(this._decryptEntries.bind(this, DecryptionSource.Timeline));
|
if (this._roomEncryption) {
|
||||||
|
this._timeline.enableEncryption(this._decryptEntries.bind(this, DecryptionSource.Timeline));
|
||||||
|
}
|
||||||
|
await this._timeline.load(this._user, this.membership, log);
|
||||||
|
} catch (err) {
|
||||||
|
// this also clears this._timeline in the closeCallback
|
||||||
|
this._timeline.dispose();
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
await this._timeline.load(this._user, this.membership, log);
|
|
||||||
return this._timeline;
|
return this._timeline;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue