Skip to content

Commit

Permalink
@uppy/transloadit: do not cancel assembly when removing all files (#5191
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Murderlon committed May 22, 2024
1 parent 67bd2fd commit 2597bb9
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/@uppy/transloadit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,19 +524,12 @@ export default class Transloadit<
} else if (fileRemoved.id in updatedFiles) {
delete updatedFiles[fileRemoved.id]
const nbOfRemainingFiles = Object.keys(updatedFiles).length
if (nbOfRemainingFiles === 0) {
assembly.close()
this.#cancelAssembly(newAssembly).catch(() => {

this.client
.updateNumberOfFilesInAssembly(newAssembly, nbOfRemainingFiles)
.catch(() => {
/* ignore potential errors */
})
this.uppy.off('file-removed', fileRemovedHandler)
} else {
this.client
.updateNumberOfFilesInAssembly(newAssembly, nbOfRemainingFiles)
.catch(() => {
/* ignore potential errors */
})
}
}
}
this.uppy.on('file-removed', fileRemovedHandler)
Expand Down

0 comments on commit 2597bb9

Please sign in to comment.