fix(AttachmentPreview): ext should not be case sensitive (#9426)

fix(AttachmentPreview): 修复图片扩展名大小写敏感问题
This commit is contained in:
Phantom 2025-08-23 12:24:38 +08:00 committed by GitHub
parent 4833f36e0b
commit 375f966e9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,7 +83,7 @@ export const getFileIcon = (type?: string) => {
export const FileNameRender: FC<{ file: FileMetadata }> = ({ file }) => {
const [visible, setVisible] = useState<boolean>(false)
const isImage = (ext: string) => {
return ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp'].includes(ext)
return ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp'].includes(ext.toLocaleLowerCase())
}
const fullName = FileManager.formatFileName(file)