finalise code
This commit is contained in:
parent
b959a6b047
commit
657fb6bb3b
|
|
@ -11,10 +11,9 @@ for (let elementName in elements) {
|
|||
}
|
||||
}
|
||||
|
||||
runAfterLoad(function() {
|
||||
let modDescriptions = {};
|
||||
let modDescriptions = {};
|
||||
|
||||
let fetchPromises = enabledMods.map(mod => {
|
||||
let fetchPromises = enabledMods.map(mod => {
|
||||
return fetch(mod)
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
|
|
@ -22,9 +21,9 @@ runAfterLoad(function() {
|
|||
modDescriptions[mod] = data;
|
||||
})
|
||||
.catch(error => console.error('Error fetching the mod file: ', error));
|
||||
});
|
||||
});
|
||||
|
||||
Promise.all(fetchPromises).then(() => {
|
||||
Promise.all(fetchPromises).then(() => {
|
||||
Object.keys(elements).forEach(function(elementName) {
|
||||
let element = elements[elementName];
|
||||
|
||||
|
|
@ -38,5 +37,4 @@ runAfterLoad(function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue