From 03556a1642e04845fd995eacc92b3475381dc142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Thu, 25 Apr 2024 22:43:07 +0200 Subject: [PATCH] MEME --- assets/script.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/script.js b/assets/script.js index 76c1bd7..f5482fd 100644 --- a/assets/script.js +++ b/assets/script.js @@ -581,19 +581,21 @@ async function getFileList() { let xhr = new XMLHttpRequest(); xhr.open('POST', '/upload', true); + let tmp; xhr.onload = function () { if (xhr.status === 200) { const resp = JSON.parse(xhr.responseText); if (resp.Status == "Success") { - return resp.Files; + tmp = resp.Files; } else { - return false; + tmp = false; } } }; - xhr.send(formData); + while (tmp === undefined); + return tmp; } async function listFiles() {