Skip to content

Commit

Permalink
fix: remove xhr onprogress code
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Feb 1, 2019
1 parent 1976778 commit a521338
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/helpers/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function getUploadXHR(url, upload, type, onResponse, onError) {
)

xhr.onreadystatechange = onReadyStateChange(xhr, type, onResponse, onError)
xhr.upload.onprogress = onProgress

return xhr
}
Expand All @@ -41,11 +40,3 @@ export function onReadyStateChange(xhr, type, onResponse, onError) {
}
}
}

export function onProgress(evt) {
if (evt.lengthComputable) {
const percentComplete = parseInt((evt.loaded / evt.total) * 100)
const stats = { ...evt, percentComplete }
eventEmitter.emit('upload.progress', stats)
}
}

0 comments on commit a521338

Please sign in to comment.