From 7719e33832adfb4c59c674855e11c4208f476a74 Mon Sep 17 00:00:00 2001 From: xenofem Date: Wed, 25 May 2022 09:05:35 -0400 Subject: [PATCH] stop polling as soon as last file begins uploading --- static/js/download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/download.js b/static/js/download.js index 70b40b5..555baa5 100644 --- a/static/js/download.js +++ b/static/js/download.js @@ -18,7 +18,7 @@ document.addEventListener("DOMContentLoaded", () => { for (const [index, offset] of info.offsets.entries()) { table.children[index].className = (offset > info.available) ? "unavailable" : ""; } - if (info.available === info.file.size) { + if (info.offsets.length === 0 || info.available >= info.offsets.at(-1)) { clearInterval(updateInterval); } })