From 4ca0f506858b58dc95bb730212822e32a8704664 Mon Sep 17 00:00:00 2001 From: G2-Games Date: Thu, 31 Oct 2024 04:51:07 -0500 Subject: [PATCH] Properly show errors in file bars again --- web/request.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/request.js b/web/request.js index 7915e3c..bb66aaa 100644 --- a/web/request.js +++ b/web/request.js @@ -83,9 +83,11 @@ async function uploadFile(file, duration, maxSize) { const [linkRow, progressBar, progressText] = await addNewToList(file.name); if (file.size > maxSize) { console.error("Provided file is too large", file.size, "bytes; max", maxSize, "bytes"); + makeErrored(progressBar, progressText, linkRow, TOO_LARGE_TEXT); return; } else if (file.size == 0) { console.error("Provided file has 0 bytes"); + makeErrored(progressBar, progressText, linkRow, ZERO_TEXT); return; } @@ -106,6 +108,7 @@ async function uploadFile(file, duration, maxSize) { chunkedResponse = await response.json(); } catch (error) { console.error(error); + makeErrored(progressBar, progressText, linkRow, ERROR_TEXT); } // Upload the file in `chunk_size` chunks