From 44206e28cbd4a92266f7c34fc25a2c7232a9f25d Mon Sep 17 00:00:00 2001 From: daniel-j Date: Wed, 6 Dec 2023 15:11:45 +0100 Subject: [PATCH] dont request status null --- download.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/download.html b/download.html index 2f7ed8c..eea067d 100644 --- a/download.html +++ b/download.html @@ -62,13 +62,18 @@ function xhr(method, url, cb) { } function pollFile () { + if (!key) { + keyOutput.textContent = '––––' + downloads.style.display = 'none' + return + } xhr('GET', '/status/' + key, function (x) { var data try { data = JSON.parse(x.responseText) } catch (err) { - keyOutput.textContent = '––––' key = null + keyOutput.textContent = '––––' downloads.style.display = 'none' return } @@ -99,8 +104,8 @@ function generateKey () { if (pollTimer) clearInterval(pollTimer) pollTimer = setInterval(pollFile, 5 * 1000) } else { - keyOutput.textContent = '––––' key = null + keyOutput.textContent = '––––' downloadlink.href = '' } keyGenBtn.blur()