mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 19:23:55 +00:00
Followup fixes for #612
//cc @goto-bus-stop should we change all progress events to file instead of fileId too? #638 might be releavant too
This commit is contained in:
parent
354231cc3c
commit
0fb5f6ba95
1 changed files with 6 additions and 6 deletions
|
|
@ -614,11 +614,11 @@ class Uppy {
|
|||
this.setState({ error: error.message })
|
||||
})
|
||||
|
||||
this.on('upload-error', (fileID, error) => {
|
||||
this.setFileState(fileID, { error: error.message })
|
||||
this.on('upload-error', (file, error) => {
|
||||
this.setFileState(file.id, { error: error.message })
|
||||
this.setState({ error: error.message })
|
||||
|
||||
const fileName = this.getState().files[fileID].name
|
||||
const fileName = file.name
|
||||
let message = `Failed to upload ${fileName}`
|
||||
if (typeof error === 'object' && error.message) {
|
||||
message = { message: message, details: error.message }
|
||||
|
|
@ -659,9 +659,9 @@ class Uppy {
|
|||
|
||||
this.on('upload-progress', _throttledCalculateProgress)
|
||||
|
||||
this.on('upload-success', (fileID, uploadResp, uploadURL) => {
|
||||
this.setFileState(fileID, {
|
||||
progress: Object.assign({}, this.getState().files[fileID].progress, {
|
||||
this.on('upload-success', (file, uploadResp, uploadURL) => {
|
||||
this.setFileState(file.id, {
|
||||
progress: Object.assign({}, this.state.files[file.id].progress, {
|
||||
uploadComplete: true,
|
||||
percentage: 100
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue