HubSpot / offline

Automatically display online/offline indication to your users
http://github.hubspot.com/offline/docs/welcome
MIT License
8.64k stars 846 forks source link

Offline.check().offline is always false #225

Open jjalonso opened 8 years ago

jjalonso commented 8 years ago

MAC 10.11.6 (15G31) El capitan Chrome Version 52.0.2743.116 (64-bit)

Hi guys.

Im testing with 0.7.17 and Offline.check() give always offline false. But Offline.state look like working when the connection change.

Anybody can confirm it?

stefankaifer commented 8 years ago

same problem here with Chrome on Android:

Offline.options = { checkOnLoad: true, checks: { xhr: { url: https://bla.com/favicon.ico } } }; Offline.on('down', function() { setOnlineStatus('offline'); }); Offline.on('up', function() { setOnlineStatus('online'); }); console.log(Offline.state); ==> up console.log(Offline.check().offline); ==> false

Wrong state and check, because, the device has no internet connection, expected

Offline.state = down Offline.check().offline = true