Skip to content

Commit

Permalink
Also do retry-all and upload events
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon committed May 9, 2024
1 parent 224da14 commit 28e0902
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/@uppy/core/src/Uppy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,13 @@ export interface _UppyEventMap<M extends Meta, B extends Body> {
'restore-canceled': () => void
'restriction-failed': (file: UppyFile<M, B> | undefined, error: Error) => void
'resume-all': () => void
'retry-all': (fileIDs: string[]) => void
'retry-all': (files: UppyFile<M, B>[]) => void
'state-update': (
prevState: State<M, B>,
nextState: State<M, B>,
patch?: Partial<State<M, B>>,
) => void
upload: (data: { id: string; fileIDs: string[] }) => void
upload: (uploadID: string, files: UppyFile<M, B>[]) => void
'upload-error': (
file: UppyFile<M, B> | undefined,
error: { name: string; message: string; details?: string },
Expand Down Expand Up @@ -1269,7 +1269,7 @@ export class Uppy<M extends Meta, B extends Body> {
error: null,
})

this.emit('retry-all', filesToRetry)
this.emit('retry-all', Object.values(updatedFiles))

if (filesToRetry.length === 0) {
return Promise.resolve({
Expand Down Expand Up @@ -1940,10 +1940,7 @@ export class Uppy<M extends Meta, B extends Body> {

const uploadID = nanoid()

this.emit('upload', {
id: uploadID,
fileIDs,
})
this.emit('upload', uploadID, this.getFiles())

this.setState({
allowNewUpload:
Expand Down

0 comments on commit 28e0902

Please sign in to comment.