Upload: check if locked before confirming delete
## Reproduce Have 2 tabs + paused upload Open "cancel" dialog in one of the tabs. Continue upload in other tab Confirm cancellation in first tab Upload disappears from both tabs, but based on network traffic the upload keeps happening. (If upload finishes the claim seems to get created)
This commit is contained in:
parent
82bb785f9d
commit
b73edf2822
1 changed files with 16 additions and 9 deletions
|
@ -46,6 +46,12 @@ export default function WebUploadItem(props: Props) {
|
|||
subtitle: __('Cancel and remove the selected upload?'),
|
||||
body: params.name ? <p className="empty">{`lbry://${params.name}`}</p> : undefined,
|
||||
onConfirm: (closeModal) => {
|
||||
if (tusIsSessionLocked(params.guid)) {
|
||||
// Corner-case: it's possible for the upload to resume in another tab
|
||||
// after the modal has appeared. Make a final lock-check here.
|
||||
// We can invoke a toast here, but just do nothing for now.
|
||||
// The upload status should make things obvious.
|
||||
} else {
|
||||
if (uploader) {
|
||||
if (resumable) {
|
||||
// $FlowFixMe - couldn't resolve to TusUploader manually.
|
||||
|
@ -57,6 +63,7 @@ export default function WebUploadItem(props: Props) {
|
|||
|
||||
// The second parameter (params) can be removed after January 2022.
|
||||
doUpdateUploadRemove(params.guid, params);
|
||||
}
|
||||
closeModal();
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue