aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorAlec Di Vito <divito.alec@gmail.com>2024-06-06 23:08:47 +0000
committerAlec Di Vito <divito.alec@gmail.com>2024-06-06 23:08:47 +0000
commit1d8b6d8f1f45047e2908506c490d175a8c0a65aa (patch)
treec905c93da579a4f2e6caafe37ab5bb63c5161b6b /src/renderer.rs
parentchore: update README.md with new option (diff)
downloadminiserve-1d8b6d8f1f45047e2908506c490d175a8c0a65aa.tar.gz
miniserve-1d8b6d8f1f45047e2908506c490d175a8c0a65aa.zip
chore: clean up
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 6c1f393..9af601c 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -702,8 +702,8 @@ fn page_header(title: &str, file_upload: bool, web_file_concurrency: usize, favi
uploadFiles()
})
- const queryLength = (state) => document.querySelectorAll(`[data-state='${state}']`).length;
function updateUploadText() {
+ const queryLength = (state) => document.querySelectorAll(`[data-state='${state}']`).length;
const total = document.querySelectorAll("[data-state]").length;
const uploads = queryLength(UPLOADING);
const pending = queryLength(PENDING);
@@ -731,7 +731,7 @@ fn page_header(title: &str, file_upload: bool, web_file_concurrency: usize, favi
// Update list of uploads
Array.from(uploadList.querySelectorAll('li'))
- .sort(({dataset: { state: a }}, {dataset: { state: b}}) => UPLOAD_ITEM_ORDER[a] >= UPLOAD_ITEM_ORDER[b])
+ .sort(({ dataset: { state: a }}, {dataset: { state: b }}) => UPLOAD_ITEM_ORDER[a] >= UPLOAD_ITEM_ORDER[b])
.forEach((item) => item.parentNode.appendChild(item))
}
@@ -748,7 +748,7 @@ fn page_header(title: &str, file_upload: bool, web_file_concurrency: usize, favi
const iterator = callbacks.entries();
const concurrency = CONCURRENCY === 0 ? callbacks.length : CONCURRENCY;
const workers = Array(concurrency).fill(iterator).map(doWork)
- Promise.allSettled(workers).then(console.log.bind(null, 'done'))
+ Promise.allSettled(workers)
.finally(() => {
updateUploadText();
form.reset();
@@ -794,7 +794,6 @@ fn page_header(title: &str, file_upload: bool, web_file_concurrency: usize, favi
formData.append('file', file);
function onReadyStateChange(e) {
- console.log('readystatechange', e)
if (e.target.readyState == 4) {
if (e.target.status == 200) {
completeSuccess()