Skip to content

Commit

Permalink
Merge pull request #35259 from nextcloud/bugfix/32354/fix-upload-actu…
Browse files Browse the repository at this point in the history
…ally-cancel-xhr

Also cancel XHR when cancelling uploads
  • Loading branch information
szaimen authored Nov 18, 2022
2 parents 8e80f04 + feda03b commit b4ab2a9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ OC.FileUpload.prototype = {
*/
id: null,

/**
* Upload data structure
*/
data: null,

/**
* Upload element
*
Expand Down Expand Up @@ -337,6 +342,10 @@ OC.FileUpload.prototype = {
return
}
this.aborted = true;
if (this.data) {
// abort running XHR
this.data.abort();
}
this._delete();
},

Expand Down

0 comments on commit b4ab2a9

Please sign in to comment.