Kaynağa Gözat

Merge branch 'master' of https://github.com/transloadit/uppy

Artur Paikin 6 yıl önce
ebeveyn
işleme
801e785b9f
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      packages/@uppy/core/src/index.js

+ 1 - 1
packages/@uppy/core/src/index.js

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