mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-28 12:37:00 +00:00
Merge pull request #245 from goto-bus-stop/tus-no-files
tus: return immediately if no files are selected, fixes #214
This commit is contained in:
commit
bbd94f993c
2 changed files with 10 additions and 10 deletions
|
|
@ -151,11 +151,6 @@ module.exports = class Multipart extends Plugin {
|
|||
}
|
||||
|
||||
selectForUpload (files) {
|
||||
if (Object.keys(files).length === 0) {
|
||||
this.core.log('no files to upload!')
|
||||
return
|
||||
}
|
||||
|
||||
files.forEach((file, i) => {
|
||||
const current = parseInt(i, 10) + 1
|
||||
const total = files.length
|
||||
|
|
@ -177,6 +172,11 @@ module.exports = class Multipart extends Plugin {
|
|||
}
|
||||
|
||||
handleUpload (fileIDs) {
|
||||
if (fileIDs.length === 0) {
|
||||
this.core.log('Multipart: no files to upload!')
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
this.core.log('Multipart is uploading...')
|
||||
const files = fileIDs.map(getFile, this)
|
||||
function getFile (fileID) {
|
||||
|
|
|
|||
|
|
@ -281,11 +281,6 @@ module.exports = class Tus10 extends Plugin {
|
|||
}
|
||||
|
||||
uploadFiles (files) {
|
||||
if (Object.keys(files).length === 0) {
|
||||
this.core.log('no files to upload!')
|
||||
return
|
||||
}
|
||||
|
||||
files.forEach((file, index) => {
|
||||
const current = parseInt(index, 10) + 1
|
||||
const total = files.length
|
||||
|
|
@ -299,6 +294,11 @@ module.exports = class Tus10 extends Plugin {
|
|||
}
|
||||
|
||||
handleUpload (fileIDs) {
|
||||
if (fileIDs.length === 0) {
|
||||
this.core.log('Tus: no files to upload!')
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
this.core.log('Tus is uploading...')
|
||||
const filesToUpload = fileIDs.map(getFile, this)
|
||||
function getFile (fileID) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue