🐛 Unknown file for file roots with no format/extension (#845)
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -9,6 +9,7 @@ export const RootPendingFilesListState = atom<
|
||||
uploadedSize: number;
|
||||
status: string;
|
||||
items: PendingFileRecoilType[];
|
||||
isUnknownFormat: boolean;
|
||||
};
|
||||
}
|
||||
| undefined
|
||||
|
||||
@@ -94,6 +94,7 @@ export type UploadRootType = {
|
||||
uploadedSize: number;
|
||||
status: string;
|
||||
items: PendingFileRecoilType[];
|
||||
isUnknownFormat: boolean;
|
||||
};
|
||||
|
||||
export type UploadRootListType = {
|
||||
|
||||
Reference in New Issue
Block a user