Quellcode durchsuchen

remove `upload-cancel` event, `file-removed` should be enough

Seems like `upload-cancel` was emitted from dashboard and listed to in xhr-upload only
Artur Paikin vor 6 Jahren
Ursprung
Commit
a596b2ee36
2 geänderte Dateien mit 0 neuen und 8 gelöschten Zeilen
  1. 0 1
      packages/@uppy/dashboard/src/index.js
  2. 0 7
      packages/@uppy/xhr-upload/src/index.js

+ 0 - 1
packages/@uppy/dashboard/src/index.js

@@ -563,7 +563,6 @@ module.exports = class Dashboard extends Plugin {
     }
     }
 
 
     const cancelUpload = (fileID) => {
     const cancelUpload = (fileID) => {
-      this.uppy.emit('upload-cancel', fileID)
       this.uppy.removeFile(fileID)
       this.uppy.removeFile(fileID)
     }
     }
 
 

+ 0 - 7
packages/@uppy/xhr-upload/src/index.js

@@ -288,13 +288,6 @@ module.exports = class XHRUpload extends Plugin {
         }
         }
       })
       })
 
 
-      this.uppy.on('upload-cancel', (fileID) => {
-        if (fileID === file.id) {
-          timer.done()
-          xhr.abort()
-        }
-      })
-
       this.uppy.on('cancel-all', () => {
       this.uppy.on('cancel-all', () => {
         timer.done()
         timer.done()
         xhr.abort()
         xhr.abort()