1
0
mirror of synced 2024-11-24 07:40:17 +01:00

web: Fix progress bar overflowing

This commit is contained in:
WerWolv 2024-02-01 12:40:37 +01:00
parent baaf84298c
commit be0e50f983

View File

@ -41,9 +41,12 @@ function monkeyPatch(progressFun) {
}
}
monkeyPatch((file, done, total) => {
let percent = ((done / total) * 100).toFixed(0);
let mibNow = (done / 1024**2).toFixed(1);
let mibTotal = (total / 1024**2).toFixed(1);
if (total === 0 || done > total)
return;
const percent = ((done / total) * 100).toFixed(0);
const mibNow = (done / 1024**2).toFixed(1);
const mibTotal = (total / 1024**2).toFixed(1);
let root = document.querySelector(':root');
root.style.setProperty("--progress", `${percent}%`)