@uppy/tus
Advanced tools
Comparing version 3.2.0 to 3.3.0
# @uppy/tus | ||
## 3.3.0 | ||
Released: 2023-09-18 | ||
Included in: Uppy v3.16.0 | ||
- @uppy/tus: Fix: Utilize user-defined onSuccess, onError, and onProgress callbacks in @uppy/tus (choi sung keun / #4674) | ||
## 3.2.0 | ||
@@ -4,0 +11,0 @@ |
@@ -15,3 +15,3 @@ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } | ||
const packageJson = { | ||
"version": "3.2.0" | ||
"version": "3.3.0" | ||
}; | ||
@@ -328,2 +328,5 @@ /** @typedef {import('..').TusOptions} TusOptions */ | ||
this.uppy.emit('upload-error', file, err); | ||
if (typeof opts.onError === 'function') { | ||
opts.onError(err); | ||
} | ||
reject(err); | ||
@@ -333,2 +336,5 @@ }; | ||
this.onReceiveUploadUrl(file, upload.url); | ||
if (typeof opts.onProgress === 'function') { | ||
opts.onProgress(bytesUploaded, bytesTotal); | ||
} | ||
this.uppy.emit('upload-progress', file, { | ||
@@ -350,2 +356,5 @@ uploader: this, | ||
} | ||
if (typeof opts.onSuccess === 'function') { | ||
opts.onSuccess(); | ||
} | ||
resolve(upload); | ||
@@ -352,0 +361,0 @@ }; |
{ | ||
"name": "@uppy/tus", | ||
"description": "Resumable uploads for Uppy using Tus.io", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -253,3 +253,5 @@ import BasePlugin from '@uppy/core/lib/BasePlugin.js' | ||
this.uppy.emit('upload-error', file, err) | ||
if (typeof opts.onError === 'function') { | ||
opts.onError(err) | ||
} | ||
reject(err) | ||
@@ -260,2 +262,5 @@ } | ||
this.onReceiveUploadUrl(file, upload.url) | ||
if (typeof opts.onProgress === 'function') { | ||
opts.onProgress(bytesUploaded, bytesTotal) | ||
} | ||
this.uppy.emit('upload-progress', file, { | ||
@@ -281,2 +286,5 @@ uploader: this, | ||
} | ||
if (typeof opts.onSuccess === 'function') { | ||
opts.onSuccess() | ||
} | ||
@@ -283,0 +291,0 @@ resolve(upload) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92358
1122