fix directory upload missing progress

This commit is contained in:
Karol Wypchlo 2021-11-04 14:21:05 +01:00
parent 03c72653c5
commit ffe7876854
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
1 changed files with 2 additions and 1 deletions

View File

@ -47,8 +47,9 @@ const Uploader = () => {
const handleDrop = async (files) => {
if (mode === "directory" && files.length) {
const name = getRootDirectory(files[0]); // get the file path from the first file
const size = files.reduce((acc, file) => acc + file.size, 0);
files = [{ name, files }];
files = [{ name, size, files }];
}
setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]);