2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

opt: opt judgment code of cancel (#4587)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
zhoulixiang
2022-05-04 01:04:58 +08:00
committed by GitHub
parent e9efc69f68
commit e52af17ee8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -402,7 +402,7 @@ module.exports = function httpAdapter(config) {
if (req.aborted) return;
req.abort();
reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
reject(!cancel || cancel.type ? new CanceledError() : cancel);
};
config.cancelToken && config.cancelToken.subscribe(onCanceled);
+1 -1
View File
@@ -193,7 +193,7 @@ module.exports = function xhrAdapter(config) {
if (!request) {
return;
}
reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
reject(!cancel || cancel.type ? new CanceledError() : cancel);
request.abort();
request = null;
};