1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Abort if call has ended and remove stray self(!)

This commit is contained in:
David Baker
2020-10-21 18:55:57 +01:00
parent d00d07a1c1
commit 1a1a0e7324

View File

@@ -942,6 +942,10 @@ export class MatrixCall extends EventEmitter {
setTimeout(resolve, 200);
});
// @ts-ignore: Typescript thinks this is impossible because of the
// check above: it has not heard of async functions
if (this.state === CallState.Ended) return;
const content = {
// OpenWebRTC appears to add extra stuff (like the DTLS fingerprint)
// to the description when setting it on the peerconnection.
@@ -1244,7 +1248,7 @@ export class MatrixCall extends EventEmitter {
this.peerConn.close();
}
if (shouldEmit) {
this.emit(CallEvent.Hangup, self);
this.emit(CallEvent.Hangup, this);
}
}