Skip to content

Commit

Permalink
fix: do not call load 2 times
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzianis Dashkevich committed Jun 6, 2024
1 parent 8dbd756 commit 1e50ee9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ function _createXHR(options) {
}

function readystatechange() {
if (xhr.readyState === 4) {
// do not call load 2 times when response interceptors are enabled
// why do we even need this 2nd load?
if (xhr.readyState === 4 && !createXHR.responseInterceptorsStorage.getIsEnabled()) {
setTimeout(loadFunc, 0)
}
}
Expand Down

0 comments on commit 1e50ee9

Please sign in to comment.