Skip to content

Commit

Permalink
@uppy/tus onSuccess, onError, and onProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoinglove committed Sep 7, 2023
1 parent 682ae7f commit 1fc9e7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/@uppy/tus/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check failure on line 253 in packages/@uppy/tus/src/index.js

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Extra semicolon
reject(err)
}

uploadOptions.onProgress = (bytesUploaded, bytesTotal) => {
this.onReceiveUploadUrl(file, upload.url)
if (typeof opts.onProgress === 'function')
opts.onProgress(bytesUploaded, bytesTotal);

Check failure on line 260 in packages/@uppy/tus/src/index.js

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Expected indentation of 10 spaces but found 8

Check failure on line 260 in packages/@uppy/tus/src/index.js

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Expected no linebreak before this statement

Check failure on line 260 in packages/@uppy/tus/src/index.js

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Expected { after 'if' condition

Check failure on line 260 in packages/@uppy/tus/src/index.js

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Extra semicolon
this.uppy.emit('upload-progress', file, {
uploader: this,
bytesUploaded,
Expand All @@ -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();

Check failure on line 281 in packages/@uppy/tus/src/index.js

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Extra semicolon

resolve(upload)
}
Expand Down

0 comments on commit 1fc9e7e

Please sign in to comment.