Skip to content

Commit

Permalink
@uppy/xhr-upload: add 'upload-stalled' event (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Dec 22, 2022
1 parent 07cff3b commit b2c91eb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/uppy-core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,24 @@ uppy.on('upload-retry', (fileID) => {
console.log('upload retried:', fileID)
})
```
### `upload-stalled`
Fired when an upload has not received any progress in some time (in `@uppy/xhr-upload`, the delay is defined by the `timeout` option). Use this event to display a message on the UI to tell the user they might want to retry the upload.
```js
uppy.on('upload-stalled', (error, files) => {
console.log('upload seems stalled', error, files)
const noLongerStalledEventHandler = (file) => {
if (files.includes(file)) {
console.log('upload is no longer stalled')
uppy.off('upload-progress', noLongerStalledEventHandler)
}
}
uppy.on('upload-progress', noLongerStalledEventHandler)
})
```
#### `retry-all`
Fired when all failed uploads are retried
Expand Down

0 comments on commit b2c91eb

Please sign in to comment.