mirror of
https://github.com/moodle/moodle.git
synced 2025-07-18 21:01:27 +02:00
MDL-63210 core: convert for loop to forEach in JS
This commit is contained in:
@@ -79,14 +79,13 @@ define(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Lo
|
||||
}
|
||||
// Something failed, reject the remaining promises.
|
||||
if (exception !== null) {
|
||||
// If the user isn't doing anything too important, redirect to the login page.
|
||||
// Redirect to the login page.
|
||||
if (exception.errorcode === "servicerequireslogin") {
|
||||
window.location = URL.relativeUrl("/login/index.php");
|
||||
} else {
|
||||
for (; i < requests.length; i++) {
|
||||
request = requests[i];
|
||||
requests.forEach(function(request) {
|
||||
request.deferred.reject(exception);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user