fix: use window.navigator.onLine for connection detection

This commit is contained in:
Jeremy Kahn 2023-03-28 09:46:10 -05:00
parent 88fad17357
commit aff6995ecc

View File

@ -56,23 +56,15 @@ export class ConnectionTest extends EventTarget {
switch (parsedCandidate.type) {
case 'host':
clearTimeout(hasHostCheckTimeout)
this.hasHost = true
this.hasHost = window.navigator.onLine
eventType = ConnectionTestEvents.HAS_HOST_CHANGED
break
case 'relay':
clearTimeout(hasRelayCheckTimeout)
this.hasRelay = true
this.hasRelay = window.navigator.onLine
eventType = ConnectionTestEvents.HAS_RELAY_CHANGED
break
case 'prflx':
this.hasPeerReflexive = true
break
case 'srflx':
this.hasServerReflexive = true
break
}
if (typeof eventType !== 'undefined') {