Skip to content

Commit

Permalink
fix: add progress bar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Sep 27, 2024
1 parent eab2721 commit a70d0dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/emulator/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ window.onload = async function()
const total = parseInt(contentLength, 10);
const reader = resp.body.getReader();
let downloaded = 0;
let downloadedForProgress = 0;

const brotli = await brotliCJS.default;
const decompStream = new brotli.DecompressStream();
Expand Down Expand Up @@ -248,9 +249,10 @@ window.onload = async function()
if ( failed ) {
throw new Error('decompression failed', resultCode);
}
downloadedForProgress += value.byteLength;
// uint8arrays.push(value);
// downloaded += value.byteLength;
// status.phase_progress = downloaded / total;
status.phase_progress = downloadedForProgress / total;
}
// const arrayBuffer = await resp.arrayBuffer();

Expand Down

0 comments on commit a70d0dd

Please sign in to comment.