We have custom logic in our app that uses setOnline(false) if our server isn't reachable. We were running into issues trying to react to this with onlineManager, and it seems the reason for this is that onOnline() (which calls the listeners) is only called when setOnline() is called with a truthy value.
This is different from the window's online status, which calls onOnline() for both online and offline events, so this seems like a bug.
The listeners should either be called both when going online and offline, or there should be an additional way to listen for going offline.
We have custom logic in our app that uses
setOnline(false)
if our server isn't reachable. We were running into issues trying to react to this withonlineManager
, and it seems the reason for this is thatonOnline()
(which calls the listeners) is only called whensetOnline()
is called with a truthy value.This is different from the
window
's online status, which callsonOnline()
for bothonline
andoffline
events, so this seems like a bug.The listeners should either be called both when going online and offline, or there should be an additional way to listen for going offline.