fix(AttachmentPreview): ext should not be case sensitive (#9426)
fix(AttachmentPreview): 修复图片扩展名大小写敏感问题
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user