wrap converters in promises

This commit is contained in:
C4illin 2024-05-25 18:09:28 +02:00
parent 7a9def556d
commit a41e5d8c99
8 changed files with 70 additions and 57 deletions

View file

@ -16,12 +16,10 @@ const main = document.querySelector("main");
const progressElem = document.querySelector("progress");
const refreshData = () => {
console.log("Refreshing data...");
console.log(progressElem.value);
console.log(progressElem.max);
if (progressElem.value !== progressElem.max) {
fetch(`/progress/${jobId}`)
fetch(`/progress/${jobId}`, {
method: "POST",
})
.then((res) => res.text())
.then((html) => {
main.innerHTML = html;