mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-21 01:15:35 +00:00
core: use setFileState inside retryUpload (#1759)
Makes it a bit easier to follow. It also logs a warning now when you do `.retryUpload(SomeNonsenseFileID)` instead of silently adding an invalid object to the state.
This commit is contained in:
parent
95a13ff52f
commit
d05f37488d
1 changed files with 3 additions and 7 deletions
|
|
@ -660,13 +660,9 @@ class Uppy {
|
|||
}
|
||||
|
||||
retryUpload (fileID) {
|
||||
const updatedFiles = Object.assign({}, this.getState().files)
|
||||
const updatedFile = Object.assign({}, updatedFiles[fileID],
|
||||
{ error: null, isPaused: false }
|
||||
)
|
||||
updatedFiles[fileID] = updatedFile
|
||||
this.setState({
|
||||
files: updatedFiles
|
||||
this.setFileState(fileID, {
|
||||
error: null,
|
||||
isPaused: false
|
||||
})
|
||||
|
||||
this.emit('upload-retry', fileID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue