Skip to content

Commit 4eb4c19

Browse files
committed
refactor: use async-await to load the data
1 parent 7cf17be commit 4eb4c19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

__brick__/web/flutter_bootstrap.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ async function beginPreloading() {
5555
}
5656

5757
async function loadBatch(urls) {
58-
const loadPromises = urls.map(url => load(url).then(reportProgress()));
58+
const loadPromises = urls.map(async (url) => {
59+
await load(url);
60+
reportProgress();
61+
});
5962
try {
6063
return await Promise.all(loadPromises);
6164
} catch (error) {

0 commit comments

Comments
 (0)