diff --git a/tdrive/frontend/src/app/components/file-uploads/pending-root-components/pending-root-row.tsx b/tdrive/frontend/src/app/components/file-uploads/pending-root-components/pending-root-row.tsx index 62e26683..8a0970c5 100644 --- a/tdrive/frontend/src/app/components/file-uploads/pending-root-components/pending-root-row.tsx +++ b/tdrive/frontend/src/app/components/file-uploads/pending-root-components/pending-root-row.tsx @@ -33,7 +33,7 @@ const PendingRootRow = ({ const uploadedFilesSize = root.uploadedSize; const uploadProgress = Math.floor((uploadedFilesSize / root.size) * 100); const isUploadCompleted = root.status === 'completed'; - const isFileRoot = rootKey.includes('.'); + const isFileRoot = root.isUnknownFormat || rootKey.includes('.'); const fileType = isFileRoot ? rootKey.split('.').pop() : ''; // Callback function to open the folder after the upload is completed diff --git a/tdrive/frontend/src/app/features/files/services/file-upload-service.ts b/tdrive/frontend/src/app/features/files/services/file-upload-service.ts index 444fedb0..607c6730 100644 --- a/tdrive/frontend/src/app/features/files/services/file-upload-service.ts +++ b/tdrive/frontend/src/app/features/files/services/file-upload-service.ts @@ -63,7 +63,7 @@ class FileUploadService { async _waitWhilePaused(id?: string) { logger.debug('===== _waitWhilePaused ======'); logger.debug('rootStates: ', this.rootStates); - logger.debug('status: ', this.uploadStatus) + logger.debug('status: ', this.uploadStatus); while (this.uploadStatus === UploadStateEnum.Paused || (id && this.rootStates.paused[id])) { if (this.uploadStatus === UploadStateEnum.Cancelled || (id && this.rootStates.cancelled[id])) return; @@ -105,6 +105,11 @@ class FileUploadService { this.rootStates.failed[key] = true; } + // Check if the root is a file with unknow format + const isUnknownFormat = + this.groupedPendingFiles[key]?.length === 1 && + this.groupedPendingFiles[key][0].originalFile?.name === key; + // Determine the upload status based on failed, cancelled, paused, completed, or uploading states const status = this.rootStates.failed[key] ? 'failed' @@ -127,6 +132,7 @@ class FileUploadService { size: this.rootSizes[key], uploadedSize, status, + isUnknownFormat, }; return acc; @@ -308,7 +314,7 @@ class FileUploadService { ): Promise { logger.debug('===== upload ====='); logger.debug('uploadStatus: ', this.uploadStatus); - + // reset the upload status when creating a new document if (fileList.length === 1 && fileList[0].root === fileList[0].file.name) { if (this.uploadStatus === UploadStateEnum.Paused) { diff --git a/tdrive/frontend/src/app/features/files/state/atoms/root-pending-files-list.ts b/tdrive/frontend/src/app/features/files/state/atoms/root-pending-files-list.ts index e0a2c2c0..aa935828 100644 --- a/tdrive/frontend/src/app/features/files/state/atoms/root-pending-files-list.ts +++ b/tdrive/frontend/src/app/features/files/state/atoms/root-pending-files-list.ts @@ -9,6 +9,7 @@ export const RootPendingFilesListState = atom< uploadedSize: number; status: string; items: PendingFileRecoilType[]; + isUnknownFormat: boolean; }; } | undefined diff --git a/tdrive/frontend/src/app/features/files/types/file.ts b/tdrive/frontend/src/app/features/files/types/file.ts index a2dfeaea..65218288 100644 --- a/tdrive/frontend/src/app/features/files/types/file.ts +++ b/tdrive/frontend/src/app/features/files/types/file.ts @@ -94,6 +94,7 @@ export type UploadRootType = { uploadedSize: number; status: string; items: PendingFileRecoilType[]; + isUnknownFormat: boolean; }; export type UploadRootListType = {