mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
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
@ -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 New Issue
Block a user