mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-28 20:40:06 +00:00
call removeFile on each file when doing cancelAll
This commit is contained in:
parent
3904879e83
commit
6463f9e1a4
1 changed files with 5 additions and 5 deletions
|
|
@ -505,8 +505,6 @@ class Uppy {
|
|||
if (removedFile.preview && isObjectURL(removedFile.preview)) {
|
||||
URL.revokeObjectURL(removedFile.preview)
|
||||
}
|
||||
|
||||
this.log(`Removed file: ${fileID}`)
|
||||
}
|
||||
|
||||
pauseResume (fileID) {
|
||||
|
|
@ -588,16 +586,18 @@ class Uppy {
|
|||
cancelAll () {
|
||||
this.emit('cancel-all')
|
||||
|
||||
// TODO Or should we just call removeFile on all files?
|
||||
const { currentUploads } = this.getState()
|
||||
const uploadIDs = Object.keys(currentUploads)
|
||||
|
||||
uploadIDs.forEach((id) => {
|
||||
this._removeUpload(id)
|
||||
})
|
||||
|
||||
const files = Object.keys(this.getState().files)
|
||||
files.forEach((fileID) => {
|
||||
this.removeFile(fileID)
|
||||
})
|
||||
|
||||
this.setState({
|
||||
files: {},
|
||||
totalProgress: 0,
|
||||
error: null
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue