mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-26 19:55:20 +00:00
tus: Start paused when restoring a paused upload.
This commit is contained in:
parent
166babea2e
commit
d21e5941fb
1 changed files with 13 additions and 2 deletions
|
|
@ -171,7 +171,11 @@ module.exports = class Tus extends Plugin {
|
|||
})
|
||||
|
||||
this.onPause(file.id, (isPaused) => {
|
||||
isPaused ? upload.abort() : upload.start()
|
||||
if (isPaused) {
|
||||
upload.abort()
|
||||
} else {
|
||||
upload.start()
|
||||
}
|
||||
})
|
||||
|
||||
this.onPauseAll(file.id, () => {
|
||||
|
|
@ -189,7 +193,10 @@ module.exports = class Tus extends Plugin {
|
|||
upload.start()
|
||||
})
|
||||
|
||||
upload.start()
|
||||
if (!file.isPaused) {
|
||||
upload.start()
|
||||
}
|
||||
|
||||
this.core.emit('core:upload-started', file.id, upload)
|
||||
})
|
||||
}
|
||||
|
|
@ -275,6 +282,10 @@ module.exports = class Tus extends Plugin {
|
|||
socket.send('resume', {})
|
||||
})
|
||||
|
||||
if (file.isPaused) {
|
||||
socket.send('pause', {})
|
||||
}
|
||||
|
||||
socket.on('progress', (progressData) => emitSocketProgress(this, progressData, file))
|
||||
|
||||
socket.on('success', (data) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue