From e1ddc5c8f6fca4587c00ad10aa73e98be7c8ac99 Mon Sep 17 00:00:00 2001 From: pancakes Date: Wed, 26 Feb 2025 18:19:29 +1000 Subject: [PATCH] [frontend/components] Fallback to detecting compose attachment type by filename extension --- Iceshrimp.Frontend/Components/ComposeAttachment.razor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Iceshrimp.Frontend/Components/ComposeAttachment.razor b/Iceshrimp.Frontend/Components/ComposeAttachment.razor index 44ad8cdd..f93c5ae4 100644 --- a/Iceshrimp.Frontend/Components/ComposeAttachment.razor +++ b/Iceshrimp.Frontend/Components/ComposeAttachment.razor @@ -10,15 +10,15 @@ @inject IStringLocalizer Loc;
- @if (File.ContentType.StartsWith("image")) + @if (File.ContentType.StartsWith("image") || Constants.CommonImageExtensions.Any(e => File.Filename.EndsWith(e))) { @File.Description } - else if (File.ContentType.StartsWith("audio")) + else if (File.ContentType.StartsWith("audio") || Constants.CommonAudioExtensions.Any(e => File.Filename.EndsWith(e))) { } - else if (File.ContentType.StartsWith("video")) + else if (File.ContentType.StartsWith("video") || Constants.CommonVideoExtensions.Any(e => File.Filename.EndsWith(e))) { }