Skip to content

Commit

Permalink
Merge pull request #69 from FoxMoss/main
Browse files Browse the repository at this point in the history
Speed Up Preloading
  • Loading branch information
velzie authored Sep 7, 2023
2 parents 07e540b + cc498ee commit 8976582
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
},
"homepage": "https://github.com/MercuryWorkshop/AliceWM#readme",
"dependencies": {
"@tomphttp/bare-server-node": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"autoprefixer": "^10.4.14",
"eslint": "=8.13.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-jsdoc": "^46.4.3",
"express": "^4.18.2",
"express-basic-auth": "^1.2.1",
"fs-readdir-recursive": "^1.1.0",
"onchange": "^7.1.0",
"postcss": "^8.4.24",
"postcss-cli": "^10.1.0",
Expand Down
8 changes: 7 additions & 1 deletion src/oobe/OobeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,15 @@ async function preloadFiles() {
* These can safely be ignored, just like the voices in
* the developers head.
*/
const chunkSize = 10;
const promises = [];
for (const item in list) {
await fetch(list[item]);
promises.push(fetch(list[item]));
if (Number(item) % chunkSize === chunkSize - 1) {
await Promise.all(promises);
}
}
await Promise.all(promises);
} catch (e) {
console.warn("error durring oobe preload", e);
}
Expand Down

0 comments on commit 8976582

Please sign in to comment.