Skip to content

Commit bcc6cfd

Browse files
committed
MOBILE-4266 app: isOnline always returned true on webapp
1 parent 2c9091c commit bcc6cfd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/services/network.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,15 @@ export class CoreNetworkService extends Network {
159159
return;
160160
}
161161

162-
const type = this.connectionType;
162+
// We cannot use navigator.onLine because it has issues in some devices.
163+
// See https://bugs.chromium.org/p/chromium/issues/detail?id=811122
164+
if (!CorePlatform.isAndroid()) {
165+
this.online = navigator.onLine;
163166

167+
return;
168+
}
169+
170+
const type = this.connectionType;
164171
let online = type !== null && type !== CoreNetworkConnection.NONE && type !== CoreNetworkConnection.UNKNOWN;
165172

166173
// Double check we are not online because we cannot rely 100% in Cordova APIs.

0 commit comments

Comments
 (0)