Fix SLICE_STARTED called multiple times

This commit is contained in:
Booteille 2024-11-20 14:12:29 +01:00
parent 9a948cc631
commit 070b2db1fb
No known key found for this signature in database
GPG Key ID: 0FE17AFD5A1F837F
1 changed files with 2 additions and 5 deletions

View File

@ -292,8 +292,7 @@ const bindDropZone = () => {
document document
.getElementById("file-browser-button") .getElementById("file-browser-button")
.addEventListener("change", (e) => { .addEventListener("change", (e) => {
console.debug(e.target.files) handleFiles(Array.from(e.target.files));
handleFiles(e.target.files);
}); });
}; };
@ -309,7 +308,7 @@ const startUpload = (
document.getElementById("results").style.display = "block"; document.getElementById("results").style.display = "block";
lufi.events.on("SLICE_STARTED", (lufiFile) => { lufi.events.once("SLICE_STARTED", (lufiFile) => {
createUploadBox(lufiFile); createUploadBox(lufiFile);
}); });
@ -406,8 +405,6 @@ const startUpload = (
}; };
const handleFiles = (files = []) => { const handleFiles = (files = []) => {
files = Array.from(files);
const isZipped = const isZipped =
document.getElementById("zip-files").getAttribute("data-checked") === document.getElementById("zip-files").getAttribute("data-checked") ===
"data-checked"; "data-checked";