Fix upload speed

This commit is contained in:
Kieran 2022-09-09 14:07:14 +01:00
parent d5f102ee14
commit 4f76c81bb7
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -62,14 +62,13 @@ export function FileUpload(props) {
setUState(UploadState.Uploading);
},
pull: async (controller) => {
console.log(controller);
let chunk = await readChunk(controller.desiredSize);
if (chunk.byteLength === 0) {
controller.close();
return;
}
calc.ReportLoaded(chunk.byteLength);
calc.ReportProgress(chunk.byteLength);
setSpeed(calc.RateWindow(5));
setProgress(offset / props.file.size);