Skip to content

Commit

Permalink
Fixes #71 XHR calls settings function after request open
Browse files Browse the repository at this point in the history
  • Loading branch information
zekenie committed Jan 24, 2020
1 parent 58f1ee3 commit 3adffaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uploaders/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export const xhrUploader = ({
const formData = new FormData();
formData.append(fileKeyName, file);
const xmlHttp = new XMLHttpRequest();
if (typeof settingsFunction === "function") settingsFunction(xmlHttp);
xmlHttp.open(method, endpoint, true);
if (typeof settingsFunction === "function") settingsFunction(xmlHttp);
xmlHttp.addEventListener("progress", event => {
if (typeof updateProgress === "function")
updateProgress(event.loaded / event.total);
Expand Down

0 comments on commit 3adffaa

Please sign in to comment.