mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
@uppy/transloadit: fix stale assemblyStatus in 'transloadit:assembly-cancelled' event (#6294)
@mifi this is small change which we missed , based on our discussion in uppy call. --------- Co-authored-by: Mikael Finstad <finstaden@gmail.com>
This commit is contained in:
parent
622daa498c
commit
ca916f6580
2 changed files with 9 additions and 1 deletions
5
.changeset/proud-spies-train.md
Normal file
5
.changeset/proud-spies-train.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@uppy/transloadit": patch
|
||||
---
|
||||
|
||||
emit updated AssemblyState in 'transloadit:assembly-cancelled' event
|
||||
|
|
@ -658,7 +658,10 @@ export default class Transloadit<
|
|||
async #cancelAssembly(assembly: AssemblyResponse) {
|
||||
await this.client.cancelAssembly(assembly)
|
||||
// TODO bubble this through AssemblyWatcher so its event handlers can clean up correctly
|
||||
this.uppy.emit('transloadit:assembly-cancelled', assembly)
|
||||
|
||||
// if assemblyStatus has been updated after the cancellation was triggered, emit the updated assemblyStatus - fallback to the method argument
|
||||
const updatedAssemblyStatus = this.assembly?.status ?? assembly
|
||||
this.uppy.emit('transloadit:assembly-cancelled', updatedAssemblyStatus)
|
||||
this.assembly = undefined
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue