MDL-58317 templates: Fix async template render
There is an edge case where we do not wait for all promises before rendering a template. This can generate "failed to pre-fetch the template" JS errors.
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -623,9 +623,10 @@ define(['core/mustache',
|
||||
for (i = 0; i < partials.length; i++) {
|
||||
var searchKey = this.currentThemeName + '/' + partials[i];
|
||||
if (searchKey in templatePromises) {
|
||||
continue;
|
||||
fetchThemAll.push(templatePromises[searchKey]);
|
||||
} else {
|
||||
fetchThemAll.push(this.cachePartials(partials[i]));
|
||||
}
|
||||
fetchThemAll.push(this.cachePartials(partials[i]));
|
||||
}
|
||||
|
||||
return $.when.apply($, fetchThemAll).then(function() {
|
||||
|
||||
Reference in New Issue
Block a user