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 committed by backportbot-nextcloud[bot]
parent 4b8bed50ab
commit 0c07d7f19e

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();
},