[frontend/components] Fallback to detecting compose attachment type by filename extension
This commit is contained in:
parent
9530e1dafc
commit
e1ddc5c8f6
1 changed files with 3 additions and 3 deletions
|
@ -10,15 +10,15 @@
|
|||
@inject IStringLocalizer<Localization> Loc;
|
||||
|
||||
<div @ref="Attachment" class="attachment" @onclick="Select" @onclick:stopPropagation="true">
|
||||
@if (File.ContentType.StartsWith("image"))
|
||||
@if (File.ContentType.StartsWith("image") || Constants.CommonImageExtensions.Any(e => File.Filename.EndsWith(e)))
|
||||
{
|
||||
<img class="thumbnail" src="@File.ThumbnailUrl" alt="@File.Description"/>
|
||||
}
|
||||
else if (File.ContentType.StartsWith("audio"))
|
||||
else if (File.ContentType.StartsWith("audio") || Constants.CommonAudioExtensions.Any(e => File.Filename.EndsWith(e)))
|
||||
{
|
||||
<Icon Name="Icons.FileAudio" Size="5em"/>
|
||||
}
|
||||
else if (File.ContentType.StartsWith("video"))
|
||||
else if (File.ContentType.StartsWith("video") || Constants.CommonVideoExtensions.Any(e => File.Filename.EndsWith(e)))
|
||||
{
|
||||
<Icon Name="Icons.FileVideo" Size="5em"/>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue