You've already forked matrix-js-sdk
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:
@@ -166,10 +166,15 @@ export class CallEventHandler {
|
||||
// Were we trying to call that user (room)?
|
||||
let existingCall;
|
||||
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 &&
|
||||
([CallState.WaitLocalMedia, CallState.CreateOffer, CallState.InviteSent].indexOf(
|
||||
thisCall.state) !== -1)) {
|
||||
isCalling
|
||||
) {
|
||||
existingCall = thisCall;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user