Open ryanm352 opened 5 years ago
fix:
setupStopProgress = () => {
const responseFunc = (response) => {
if ((--this.requestsCounter) === 0) {
NProgress.done();
}
return response;
};
const errorFunc = (error) => {
return Promise.reject(error).then(this.reset, this.reset);
};
this.instance.interceptors.response.use(responseFunc, errorFunc);
};
reset() {
NProgress.remove();
}
When axios encounters a connection refused error, the progress bar doesn't disappear when the request has failed.