diff --git a/src/services/webRTC/index.ts b/src/services/webRTC/index.ts index 721ef8e9..9e684e79 100644 --- a/src/services/webRTC/index.ts +++ b/src/services/webRTC/index.ts @@ -52,7 +52,7 @@ export default class webRTC { const key = this.getConnectionsKey(u) console.log("connect", key) if (this.connections[key]) { - throw new Error('Connection already exists') + this.connections[key].close() } const conn = new wrtc.RTCPeerConnection(configuration) as RTCPeerConnection conn.onicecandidate = (event) => {