mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 18:29:09 +00:00
Add reason argument to removeFiles
This commit is contained in:
parent
945b7b92fb
commit
eab4ddd55c
2 changed files with 6 additions and 6 deletions
|
|
@ -711,7 +711,7 @@ class Uppy {
|
|||
}
|
||||
}
|
||||
|
||||
removeFiles (fileIDs) {
|
||||
removeFiles (fileIDs, reason) {
|
||||
const { files, currentUploads } = this.getState()
|
||||
const updatedFiles = { ...files }
|
||||
const updatedUploads = { ...currentUploads }
|
||||
|
|
@ -764,7 +764,7 @@ class Uppy {
|
|||
|
||||
const removedFileIDs = Object.keys(removedFiles)
|
||||
removedFileIDs.forEach((fileID) => {
|
||||
this.emit('file-removed', removedFiles[fileID])
|
||||
this.emit('file-removed', removedFiles[fileID], reason)
|
||||
})
|
||||
|
||||
if (removedFileIDs.length > 5) {
|
||||
|
|
@ -774,8 +774,8 @@ class Uppy {
|
|||
}
|
||||
}
|
||||
|
||||
removeFile (fileID) {
|
||||
this.removeFiles([fileID])
|
||||
removeFile (fileID, reason = null) {
|
||||
this.removeFiles([fileID], reason)
|
||||
}
|
||||
|
||||
pauseResume (fileID) {
|
||||
|
|
@ -866,7 +866,7 @@ class Uppy {
|
|||
|
||||
const fileIDs = Object.keys(files)
|
||||
if (fileIDs.length) {
|
||||
this.removeFiles(fileIDs)
|
||||
this.removeFiles(fileIDs, 'cancel-all')
|
||||
}
|
||||
|
||||
this.setState({
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ module.exports = function Buttons (props) {
|
|||
i18n={i18n}
|
||||
info={props.info}
|
||||
log={props.log}
|
||||
onClick={() => removeFile(file.id)}
|
||||
onClick={() => removeFile(file.id, 'removed-by-user')}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue