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);