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() {