Reduce preload timeout

This commit is contained in:
Varun Patil 2020-10-20 04:05:30 +05:30
parent eedee762b7
commit 0fa7a4e687
1 changed files with 8 additions and 8 deletions

View File

@ -280,15 +280,15 @@
return response.json();
})
.then(function(jsonResponse) {
jsonResponse.forEach((f) => {
const url = mapping[f.toLowerCase().replace(new RegExp("\\.[^/.]+$"), "")];
if (!url) return;
setTimeout(() => {
jsonResponse.forEach((f) => {
const url = mapping[f.toLowerCase().replace(new RegExp("\\.[^/.]+$"), "")];
if (!url) return;
// Preload the asset
setTimeout(() => {
fetch('gameasync/' + url).then().catch();
}, 1000);
});
// Preload the asset
fetch('gameasync/' + url).then().catch();
});
}, 200);
});
};