mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
Fix remote google drive upload on client side
This commit is contained in:
parent
13769bbad1
commit
ed7c0aa5f3
3 changed files with 8 additions and 8 deletions
|
|
@ -121,7 +121,8 @@ export default class Core {
|
|||
},
|
||||
data: file.data,
|
||||
progress: 0,
|
||||
isRemote: file.isRemote
|
||||
isRemote: file.isRemote,
|
||||
remote: file.remote
|
||||
}
|
||||
|
||||
this.setState({files: updatedFiles})
|
||||
|
|
|
|||
|
|
@ -158,9 +158,11 @@ export default class Google extends Plugin {
|
|||
*/
|
||||
addFile (file) {
|
||||
const tagFile = {
|
||||
source: this,
|
||||
data: file,
|
||||
name: file.title,
|
||||
type: file.mimeType,
|
||||
type: this.getFileType(file),
|
||||
isRemote: true,
|
||||
remote: {
|
||||
url: `${this.opts.host}/google/get?fileId=${file.id}`,
|
||||
body: {
|
||||
|
|
@ -169,10 +171,7 @@ export default class Google extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
this.core.emitter.emit('file-add', {
|
||||
plugin: this,
|
||||
acquiredFiles: [tagFile]
|
||||
})
|
||||
this.core.emitter.emit('file-add', tagFile)
|
||||
}
|
||||
|
||||
handleUploadError (response) {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export default class Tus10 extends Plugin {
|
|||
|
||||
const filesForUpload = {}
|
||||
Object.keys(files).forEach((file) => {
|
||||
if (files[file].progress === 0 || files[file].remote) {
|
||||
if (files[file].progress === 0 || files[file].isRemote) {
|
||||
filesForUpload[file] = files[file]
|
||||
}
|
||||
})
|
||||
|
|
@ -86,7 +86,7 @@ export default class Tus10 extends Plugin {
|
|||
const current = parseInt(i, 10) + 1
|
||||
const total = files.length
|
||||
|
||||
if (!files[i].remote) {
|
||||
if (!files[i].isRemote) {
|
||||
uploaders.push(this.upload(file, current, total))
|
||||
} else {
|
||||
uploaders.push(this.uploadRemote(file, current, total))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue