You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-01 04:43:29 +03:00
Make sure to callLengthInterval only once
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -1572,10 +1572,13 @@ export class MatrixCall extends EventEmitter {
|
||||
// chrome doesn't implement any of the 'onstarted' events yet
|
||||
if (this.peerConn.iceConnectionState == 'connected') {
|
||||
this.setState(CallState.Connected);
|
||||
|
||||
if (!this.callLengthInterval) {
|
||||
this.callLengthInterval = setInterval(() => {
|
||||
this.callLength++;
|
||||
this.emit(CallEvent.LengthChanged, this.callLength);
|
||||
}, 1000);
|
||||
}
|
||||
} else if (this.peerConn.iceConnectionState == 'failed') {
|
||||
this.hangup(CallErrorCode.IceFailed, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user