From 6893d43c46b20ae3126f4e57e97c6c910453d2a4 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 16:00:06 +0000 Subject: [PATCH] . --- rapids/templates/rapids/rapid_form.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 79e38657..a62177d0 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -84,7 +84,9 @@ for (let j = 0; j < inputs.length; j++) { i = inputs.get(j); console.log(i) - files.add(i.files[0]); + if (i.files.length > 0) { + files.add(i.files[0]); + } console.log(i.files) } return files; @@ -286,14 +288,15 @@ for (var i = 0; i < items.length; i++) { files_to_add.add(await items[i].handle - .getFile()); + .getFile()); } current_files = getCurrentFiles(); console.log("1", files_to_add, current_files); let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); - console.log("distinct set", distinct_set.length, items); + console.log("distinct set", distinct_set.length, + items); extendInputs(distinct_set.length); distinct_set.forEach((file) => { addFile(file, false);