diff --git a/packages/@uppy/tus/src/index.js b/packages/@uppy/tus/src/index.js index 377c74c7e6..5746d3c64a 100644 --- a/packages/@uppy/tus/src/index.js +++ b/packages/@uppy/tus/src/index.js @@ -250,12 +250,14 @@ export default class Tus extends BasePlugin { queuedRequest?.abort() this.uppy.emit('upload-error', file, err) - + if (typeof opts.onError === 'function') opts.onError(err); reject(err) } uploadOptions.onProgress = (bytesUploaded, bytesTotal) => { this.onReceiveUploadUrl(file, upload.url) + if (typeof opts.onProgress === 'function') + opts.onProgress(bytesUploaded, bytesTotal); this.uppy.emit('upload-progress', file, { uploader: this, bytesUploaded, @@ -276,6 +278,7 @@ export default class Tus extends BasePlugin { if (upload.url) { this.uppy.log(`Download ${upload.file.name} from ${upload.url}`) } + if (typeof opts.onSuccess === 'function') opts.onSuccess(); resolve(upload) }