From d050b8e6ed8e6aba2a8937847294b97ad25e1520 Mon Sep 17 00:00:00 2001 From: Claus Lohmar Date: Thu, 23 Jul 2026 11:11:47 +0000 Subject: [PATCH] fix: progress bar min 1% + spinner for first 5% --- frontend/templates/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/templates/index.html b/frontend/templates/index.html index 366c7fd..79146c2 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -159,11 +159,11 @@ async function handleUpload(formData) { xhr.upload.addEventListener('progress', (e) => { console.log('upload', e.loaded, e.total, e.lengthComputable); if (e.lengthComputable) { - const pct = Math.round((e.loaded / e.total) * 100); + const pct = Math.max(1, Math.round((e.loaded / e.total) * 100)); const mb = (e.loaded / (1024**2)).toFixed(0); const gb = (e.loaded / (1024**3)).toFixed(1); const size = e.loaded > 100*1024*1024 ? gb + ' GiB' : mb + ' MB'; - setPhase('Uploading source file... ' + size, pct, false); + setPhase('Uploading source file... ' + size, pct, pct < 5); } else { const mb = (e.loaded / (1024**2)).toFixed(0); setPhase('Uploading source file... ' + mb + ' MB', 0, true);