X-Git-Url: https://git.kengrimes.com/?a=blobdiff_plain;f=client.js;h=cb3872fed4563fa532d7b6209d059e6a8c1a35af;hb=db732e6001859d6f3900ecf1d921513bc24a5c23;hp=eab31877a4d57e701d2e962a75fc8cc67282c87b;hpb=0ff5eabbfe914a66b7f6b2a7f22f6469895ab826;p=henge%2Fkiak.git diff --git a/client.js b/client.js index eab3187..cb3872f 100644 --- a/client.js +++ b/client.js @@ -85,7 +85,7 @@ function pollServerForAnswer(url, data, resolve, reject) { /* Poll server for ice candidates until ice is complete */ function pollServerForICECandidate(cpc) { window.setInterval(() => { - if (cpc.iceGatheringState !== 'complete') { + if (cpc.iceGatheringState.localeCompare('complete') === 0) { return new Promise((resolve, reject) => { console.log('Client: Requesting ICE Candidates from server') const request = new XMLHttpRequest() @@ -108,6 +108,7 @@ function pollServerForICECandidate(cpc) { } request.send(cpc.pubKey) }).then((response) => { + console.log('Client: Adding Ice Candidate ') cpc.addIceCandidate(response.candidate) }).catch((err) => { console.log('pollServerForICECandidate: ' + err)