mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Bypass the tests being weird
They run kinda-but-not-really async, which can lead to early/late calls to `stop()`
This commit is contained in:
parent
3c45a39caa
commit
07b8e128d2
@ -66,7 +66,14 @@ export class Mjolnir {
|
||||
|
||||
stop() {
|
||||
SettingsStore.unwatchSetting(this._mjolnirWatchRef);
|
||||
dis.unregister(this._dispatcherRef);
|
||||
|
||||
try {
|
||||
if (this._dispatcherRef) dis.unregister(this._dispatcherRef);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
// Only the tests cause problems with this particular block of code. We should
|
||||
// never be here in production.
|
||||
}
|
||||
|
||||
if (!MatrixClientPeg.get()) return;
|
||||
MatrixClientPeg.get().removeListener("RoomState.events", this._onEvent.bind(this));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user