mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-25 01:31:22 +01:00
Merge pull request #538 from Salzian/parallel-settings-loading
Parallelized initial settings loading
This commit is contained in:
commit
7cdc8213fa
@ -299,15 +299,17 @@ export class BlueMapApp {
|
||||
|
||||
// create maps
|
||||
if (settings.maps !== undefined){
|
||||
for (let mapId of settings.maps) {
|
||||
let loadingPromises = settings.maps.map(mapId => {
|
||||
let map = new BlueMapMap(mapId, this.dataUrl + mapId + "/", this.loadBlocker, this.mapViewer.events);
|
||||
maps.push(map);
|
||||
|
||||
await map.loadSettings(this.mapViewer.tileCacheHash)
|
||||
return map.loadSettings(this.mapViewer.tileCacheHash)
|
||||
.catch(error => {
|
||||
alert(this.events, `Failed to load settings for map '${map.data.id}':` + error, "warning");
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
await Promise.all(loadingPromises);
|
||||
}
|
||||
|
||||
// sort maps
|
||||
|
Loading…
Reference in New Issue
Block a user