stop polling as soon as last file begins uploading

main
xenofem 2022-05-25 09:05:35 -04:00
parent 6ef96a9dc5
commit 7719e33832
1 changed files with 1 additions and 1 deletions

View File

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