quik patchin

This commit is contained in:
May 2023-07-02 22:54:09 -07:00
parent b93fd38bcd
commit dd0a080ba8

View file

@ -71,17 +71,22 @@
}) })
} }
let upload_files = () => { let upload_files = async () => {
uploadInProgress = true uploadInProgress = true
let sequential = localStorage.getItem("sequentialMode") == "true"
// go through all files // go through all files
Object.entries(uploads).forEach(([x,v]) => { for (let [x,v] of Object.entries(uploads)) {
// quick patch-in to allow for a switch to have everything upload sequentially
// switch will have a proper menu option later, for now i'm lazy so it's just gonna be a Secret
let hdl = () => {
switch(v.type) { switch(v.type) {
case "upload": case "upload":
let fd = new FormData() let fd = new FormData()
fd.append("file",v.file) fd.append("file",v.file)
handle_fetch_promise(x,fetch("/upload",{ return handle_fetch_promise(x,fetch("/upload",{
headers: { headers: {
"monofile-params": JSON.stringify(v.params) "monofile-params": JSON.stringify(v.params)
}, },
@ -90,7 +95,7 @@
})) }))
break break
case "clone": case "clone":
handle_fetch_promise(x,fetch("/clone",{ return handle_fetch_promise(x,fetch("/clone",{
method: "POST", method: "POST",
body: JSON.stringify({ body: JSON.stringify({
url: v.url, url: v.url,
@ -99,7 +104,11 @@
})) }))
break break
} }
}) }
if (sequential) await hdl();
else hdl();
}
} }
// animation // animation