1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Hopefully make if statement clearer

This commit is contained in:
David Baker
2020-10-09 17:26:06 +01:00
parent f845100062
commit 9d9c2720c2

View File

@@ -166,10 +166,15 @@ export class CallEventHandler {
// Were we trying to call that user (room)? // Were we trying to call that user (room)?
let existingCall; let existingCall;
for (const thisCall of this.calls.values()) { for (const thisCall of this.calls.values()) {
if (call.roomId === thisCall.roomId && const isCalling = [CallState.WaitLocalMedia, CallState.CreateOffer, CallState.InviteSent].includes(
thisCall.state,
);
if (
call.roomId === thisCall.roomId &&
thisCall.direction === CallDirection.Outbound && thisCall.direction === CallDirection.Outbound &&
([CallState.WaitLocalMedia, CallState.CreateOffer, CallState.InviteSent].indexOf( isCalling
thisCall.state) !== -1)) { ) {
existingCall = thisCall; existingCall = thisCall;
break; break;
} }