Also cancel XHR when cancelling uploads

Fixes issue when cancelling a long list of uploads.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
Vincent Petry 2022-11-18 15:47:19 +01:00
parent 473647a467
commit feda03b6ed
No known key found for this signature in database
GPG key ID: E055D6A4D513575C

View file

@ -75,6 +75,11 @@ OC.FileUpload.prototype = {
*/
id: null,
/**
* Upload data structure
*/
data: null,
/**
* Upload element
*
@ -337,6 +342,10 @@ OC.FileUpload.prototype = {
return
}
this.aborted = true;
if (this.data) {
// abort running XHR
this.data.abort();
}
this._delete();
},