Bladeren bron

wait for addFile before proceeding

Artur Paikin 7 jaren geleden
bovenliggende
commit
2b9a6cdfd1
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  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
         isRecording: false
       })
       })
       return this.getVideo()
       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.recordingChunks = null
       this.recorder = null
       this.recorder = null
+      const dashboard = this.uppy.getPlugin('Dashboard')
+      if (dashboard) dashboard.hideAllPanels()
     }, (error) => {
     }, (error) => {
       this.recordingChunks = null
       this.recordingChunks = null
       this.recorder = null
       this.recorder = null