Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit fbc5f2c

Browse files
author
Stanislav Idolov
authored
ENGCOM-1485: [Forwardport] Fix infinite checkout loader when some script wasn't loaded correctly because of network error #15072
2 parents 8f7d2f4 + 374ae80 commit fbc5f2c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/web/mage/requirejs/resolver.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,28 @@ define([
2727
return !!_.findWhere(callbacks, callback);
2828
}
2929

30+
/**
31+
* Checks if provided module is rejected during load.
32+
*
33+
* @param {Object} module - Module to be checked.
34+
* @return {Boolean}
35+
*/
36+
function isRejected(module) {
37+
return registry[module.id] && registry[module.id].error;
38+
}
39+
3040
/**
3141
* Checks if provided module has unresolved dependencies.
3242
*
3343
* @param {Object} module - Module to be checked.
3444
* @returns {Boolean}
3545
*/
3646
function isPending(module) {
37-
return !!module.depCount;
47+
if (!module.depCount) {
48+
return false;
49+
}
50+
51+
return module.depCount > _.filter(module.depMaps, isRejected).length;
3852
}
3953

4054
/**

0 commit comments

Comments
 (0)