fix: use window.navigator.onLine for connection detection
This commit is contained in:
parent
88fad17357
commit
aff6995ecc
@ -56,23 +56,15 @@ export class ConnectionTest extends EventTarget {
|
|||||||
switch (parsedCandidate.type) {
|
switch (parsedCandidate.type) {
|
||||||
case 'host':
|
case 'host':
|
||||||
clearTimeout(hasHostCheckTimeout)
|
clearTimeout(hasHostCheckTimeout)
|
||||||
this.hasHost = true
|
this.hasHost = window.navigator.onLine
|
||||||
eventType = ConnectionTestEvents.HAS_HOST_CHANGED
|
eventType = ConnectionTestEvents.HAS_HOST_CHANGED
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'relay':
|
case 'relay':
|
||||||
clearTimeout(hasRelayCheckTimeout)
|
clearTimeout(hasRelayCheckTimeout)
|
||||||
this.hasRelay = true
|
this.hasRelay = window.navigator.onLine
|
||||||
eventType = ConnectionTestEvents.HAS_RELAY_CHANGED
|
eventType = ConnectionTestEvents.HAS_RELAY_CHANGED
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'prflx':
|
|
||||||
this.hasPeerReflexive = true
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'srflx':
|
|
||||||
this.hasServerReflexive = true
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof eventType !== 'undefined') {
|
if (typeof eventType !== 'undefined') {
|
||||||
|
Loading…
Reference in New Issue
Block a user