diff --git a/frontend/src/components/fileManager/FileInfoCard.tsx b/frontend/src/components/fileManager/FileInfoCard.tsx index 60dcbb979..8ff398e96 100644 --- a/frontend/src/components/fileManager/FileInfoCard.tsx +++ b/frontend/src/components/fileManager/FileInfoCard.tsx @@ -125,11 +125,11 @@ const FileInfoCard: React.FC = ({ {t('fileManager.toolChain', 'Tools Applied')} - diff --git a/frontend/src/components/fileManager/FileListItem.tsx b/frontend/src/components/fileManager/FileListItem.tsx index a5dd5b1ba..0a40be0e6 100644 --- a/frontend/src/components/fileManager/FileListItem.tsx +++ b/frontend/src/components/fileManager/FileListItem.tsx @@ -103,12 +103,12 @@ const FileListItem: React.FC = ({ • {lineagePath.length} versions )} - + {/* Tool chain for processed files */} {file.historyInfo?.toolChain && file.historyInfo.toolChain.length > 0 && ( - @@ -163,8 +163,8 @@ const FileListItem: React.FC = ({ onToggleExpansion(leafFileId); }} > - {isExpanded ? - t('fileManager.hideHistory', 'Hide History') : + {isExpanded ? + t('fileManager.hideHistory', 'Hide History') : t('fileManager.showHistory', 'Show History') } diff --git a/frontend/src/hooks/useFileManager.ts b/frontend/src/hooks/useFileManager.ts index f47430fd2..99b4b6c46 100644 --- a/frontend/src/hooks/useFileManager.ts +++ b/frontend/src/hooks/useFileManager.ts @@ -13,38 +13,6 @@ export const useFileManager = () => { throw new Error('IndexedDB context not available'); } - // Handle drafts differently from regular files - if (fileMetadata.isDraft) { - // Load draft from the drafts database - try { - const { indexedDBManager, DATABASE_CONFIGS } = await import('../services/indexedDBManager'); - const db = await indexedDBManager.openDatabase(DATABASE_CONFIGS.DRAFTS); - - return new Promise((resolve, reject) => { - const transaction = db.transaction(['drafts'], 'readonly'); - const store = transaction.objectStore('drafts'); - const request = store.get(fileMetadata.id); - - request.onsuccess = () => { - const draft = request.result; - if (draft && draft.pdfData) { - const file = new File([draft.pdfData], fileMetadata.name, { - type: 'application/pdf', - lastModified: fileMetadata.lastModified - }); - resolve(file); - } else { - reject(new Error('Draft data not found')); - } - }; - - request.onerror = () => reject(request.error); - }); - } catch (error) { - throw new Error(`Failed to load draft: ${fileMetadata.name} (${error})`); - } - } - // Regular file loading if (fileMetadata.id) { const file = await indexedDB.loadFile(fileMetadata.id);