I'd rather have this if statement be something like
```
if (error.e === 'netOffline') {
  document.addEventListener('visibilitychange', checkConnection);
 ...
}
```
That way, if we every add other connection handlers later, it is more clear what to do.