Await on binary data download requests

This commit is contained in:
D. Berge
2025-07-28 11:09:55 +02:00
parent 3413641c10
commit 580e94a591

View File

@@ -582,7 +582,7 @@ export default {
}
};
return new Promise((resolve, reject) => {
return new Promise( async (resolve, reject) => {
const cb = (err, res) => {
if (res && !err) {
const etag = res.headers.get("ETag");
@@ -594,7 +594,10 @@ export default {
}
};
self.api([url, init, cb, {cache: true}]);
// Technically we do not need to await but this is
// to slow down the cient and avoid firing too many
// requests at once.
await self.api([url, init, cb, {cache: true}]);
});
}