Kaynağa Gözat

wait for addFile before proceeding

Artur Paikin 7 yıl önce
ebeveyn
işleme
2b9a6cdfd1
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5 5
      src/plugins/Webcam/index.js

+ 5 - 5
src/plugins/Webcam/index.js

@@ -168,13 +168,13 @@ module.exports = class Webcam extends Plugin {
         isRecording: false
       })
       return this.getVideo()
-    }).then((file) => {
-      this.uppy.addFile(file)
-      const dashboard = this.uppy.getPlugin('Dashboard')
-      if (dashboard) dashboard.hideAllPanels()
-    }).then(() => {
+    })
+    .then(this.uppy.addFile)
+    .then(() => {
       this.recordingChunks = null
       this.recorder = null
+      const dashboard = this.uppy.getPlugin('Dashboard')
+      if (dashboard) dashboard.hideAllPanels()
     }, (error) => {
       this.recordingChunks = null
       this.recorder = null