refactor: upload progress calculation (#5350)

This commit is contained in:
Ramires Viana
2025-08-06 11:47:48 -03:00
committed by GitHub
parent 6d620c00a1
commit c14cf86f83
10 changed files with 321 additions and 412 deletions

View File

@@ -132,7 +132,6 @@ export function handleFiles(
layoutStore.closeHovers();
for (const file of files) {
const id = uploadStore.id;
let path = base;
if (file.fullPath !== undefined) {
@@ -145,14 +144,8 @@ export function handleFiles(
path += "/";
}
const item: UploadItem = {
id,
path,
file,
overwrite,
...(!file.isDir && { type: detectType((file.file as File).type) }),
};
const type = file.isDir ? "dir" : detectType((file.file as File).type);
uploadStore.upload(item);
uploadStore.upload(path, file.name, file.file ?? null, overwrite, type);
}
}