check for typeof document !== 'undefined' instead of window to fix React Native

This commit is contained in:
Artur Paikin 2018-07-15 15:51:53 -04:00
parent c4f7d33c69
commit 068e6e837d

View file

@ -785,7 +785,7 @@ class Uppy {
})
// show informer if offline
if (typeof window !== 'undefined') {
if (typeof document !== 'undefined') {
window.addEventListener('online', () => this.updateOnlineStatus())
window.addEventListener('offline', () => this.updateOnlineStatus())
setTimeout(() => this.updateOnlineStatus(), 3000)