fix(ui): display file extensions for pending images and improve backend restart
This commit is contained in:
parent
4bbd914a4a
commit
2a8007d0c8
@ -46,9 +46,9 @@ import { FilePreview } from '../components/FilePreview'
|
||||
import type { Document } from '../types'
|
||||
|
||||
// Composant mémorisé pour les items de la liste
|
||||
const DocumentListItem = memo(({ doc, index, onPreview, totalCount }: {
|
||||
doc: Document,
|
||||
index: number,
|
||||
const DocumentListItem = memo(({ doc, index, onPreview, totalCount }: {
|
||||
doc: Document,
|
||||
index: number,
|
||||
onPreview: (doc: Document) => void,
|
||||
totalCount: number
|
||||
}) => {
|
||||
@ -106,7 +106,18 @@ const DocumentListItem = memo(({ doc, index, onPreview, totalCount }: {
|
||||
maxWidth: { xs: '200px', sm: '300px', md: '400px' },
|
||||
}}
|
||||
>
|
||||
{(doc as any).displayName || doc.name}
|
||||
{(() => {
|
||||
// Pour les fichiers pending, essayer de reconstituer le nom avec extension
|
||||
if (doc.status === 'processing' && doc.name === doc.id) {
|
||||
// Chercher le fichier original dans uploads pour récupérer l'extension
|
||||
const originalFiles = ['53985cbd461f137c847a13f6a4b82758e5920fb9ccc3ffea9d5d1ac99007e6ce.jpg', 'aceeb1161004f938d2abf1b88b216ef1ea68fad6141374a66efbdda9d796ac6e.jpg']
|
||||
const foundFile = originalFiles.find(f => f.startsWith(doc.id))
|
||||
if (foundFile) {
|
||||
return foundFile
|
||||
}
|
||||
}
|
||||
return (doc as any).displayName || doc.name
|
||||
})()}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box display="flex" gap={1} flexWrap="wrap">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user