stop polling as soon as last file begins uploading

This commit is contained in:
xenofem 2022-05-25 09:05:35 -04:00
parent 6ef96a9dc5
commit 7719e33832

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