Fix Bug 69320 - Files.Uploads. When loading a folder, temporary/hidden files are also loaded.

This commit is contained in:
Alexey Safronov 2024-07-22 15:47:19 +04:00
parent 2c683c3ba6
commit 2f80e76b04

View File

@ -707,6 +707,14 @@ class UploadDataStore {
}; };
startUpload = (uploadFiles, folderId, t) => { startUpload = (uploadFiles, folderId, t) => {
const withoutHiddenFiles = Object.values(uploadFiles).filter((f) => {
const isHidden = /(^|\/)\.[^\/\.]/g.test(f.name);
return !isHidden;
});
console.log("startUpload", { withoutHiddenFiles, uploadFiles });
const { canConvert } = this.filesSettingsStore; const { canConvert } = this.filesSettingsStore;
const toFolderId = folderId ? folderId : this.selectedFolderStore.id; const toFolderId = folderId ? folderId : this.selectedFolderStore.id;
@ -728,10 +736,10 @@ class UploadDataStore {
let filesSize = 0; let filesSize = 0;
let convertSize = 0; let convertSize = 0;
const uploadFilesArray = Object.keys(uploadFiles); const uploadFilesArray = Object.keys(withoutHiddenFiles);
const hasFolder = const hasFolder =
uploadFilesArray.findIndex((_, ind) => { uploadFilesArray.findIndex((_, ind) => {
const file = uploadFiles[ind]; const file = withoutHiddenFiles[ind];
const filePath = file.path const filePath = file.path
? file.path ? file.path
@ -746,13 +754,13 @@ class UploadDataStore {
if (this.uploaded) { if (this.uploaded) {
this.isParallel = false; this.isParallel = false;
} else if (this.isParallel) { } else if (this.isParallel) {
this.tempFiles.push({ uploadFiles, folderId, t }); this.tempFiles.push({ withoutHiddenFiles, folderId, t });
return; return;
} }
} }
for (let index of uploadFilesArray) { for (let index of uploadFilesArray) {
const file = uploadFiles[index]; const file = withoutHiddenFiles[index];
const parts = file.name.split("."); const parts = file.name.split(".");
const ext = parts.length > 1 ? "." + parts.pop() : ""; const ext = parts.length > 1 ? "." + parts.pop() : "";