Fixed critical bug that made the site unreachable if an incorrect request to /status/ was made
This commit is contained in:
parent
c1e69ac51f
commit
97158b2ecf
2 changed files with 3 additions and 0 deletions
|
@ -81,6 +81,8 @@ router.get('/status/:uuid', function (req, res ,next) {
|
||||||
let uuid = req.params.uuid;
|
let uuid = req.params.uuid;
|
||||||
if (progress[uuid]) {
|
if (progress[uuid]) {
|
||||||
res.send(progress[uuid]);
|
res.send(progress[uuid]);
|
||||||
|
} else {
|
||||||
|
res.send(undefined);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -267,6 +267,7 @@ Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for a
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
xhttp.addEventListener("load", function(event) {
|
xhttp.addEventListener("load", function(event) {
|
||||||
console.log(event.target.responseText);
|
console.log(event.target.responseText);
|
||||||
|
if (event.target.responseText === '') return;
|
||||||
document.getElementsByTagName("progress")[0].value = event.target.responseText;
|
document.getElementsByTagName("progress")[0].value = event.target.responseText;
|
||||||
document.getElementsByTagName("progress")[0].innerHTML = `${event.target.responseText}%`;
|
document.getElementsByTagName("progress")[0].innerHTML = `${event.target.responseText}%`;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue