From aff6995ecc82303e07b9c0722b796150efa9c66a Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Tue, 28 Mar 2023 09:46:10 -0500 Subject: [PATCH] fix: use window.navigator.onLine for connection detection --- src/services/ConnectionTest/ConnectionTest.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/services/ConnectionTest/ConnectionTest.ts b/src/services/ConnectionTest/ConnectionTest.ts index 3d655b8..4584bb4 100644 --- a/src/services/ConnectionTest/ConnectionTest.ts +++ b/src/services/ConnectionTest/ConnectionTest.ts @@ -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') {