fix: render fresh upload progress as empty
A newly selected file has no server upload record yet, so the UI calls the progress renderer with zero completed chunks and zero total chunks. Treating that zero-total state as complete made the progress bar jump to 100% before any upload had started. Render zero-total progress as empty instead. Existing resumable uploads still show their server-authoritative completed chunk percentage, and completed non-empty uploads still render as full because their completed count equals a non-zero total. Test Plan: - just static-check - just test - git diff --check
This commit is contained in:
+1
-1
@@ -198,7 +198,7 @@ function renderButtons() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateProgress(completedCount, totalChunks) {
|
function updateProgress(completedCount, totalChunks) {
|
||||||
const percentage = totalChunks === 0 ? 100 : (completedCount / totalChunks) * 100;
|
const percentage = totalChunks === 0 ? 0 : (completedCount / totalChunks) * 100;
|
||||||
progressBar.style.width = `${percentage}%`;
|
progressBar.style.width = `${percentage}%`;
|
||||||
progressMeta.textContent = `${completedCount} of ${totalChunks} chunks`;
|
progressMeta.textContent = `${completedCount} of ${totalChunks} chunks`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user