Ignore casing to check if file extensions can be previewed
All checks were successful
continuous-integration/drone/pr Build is passing

Now .PNG is supported as well as .PnG and so on
This commit is contained in:
Elscrux 2024-06-02 11:40:13 +02:00
parent aac01c7a35
commit 0963591a9e
3 changed files with 3 additions and 3 deletions

View File

@ -273,7 +273,7 @@ async function viewOrDownload(attachment: IAttachment) {
}
function canPreview(attachment: IAttachment): boolean {
return SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.endsWith(suffix))
return SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.toLowerCase().endsWith(suffix))
}
const copy = useCopyToClipboard()

View File

@ -41,7 +41,7 @@ watchEffect(async () => {
})
function canPreview(attachment: IAttachment): boolean {
return SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.endsWith(suffix))
return SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.toLowerCase().endsWith(suffix))
}
</script>

View File

@ -162,7 +162,7 @@ async function maybeDownloadCoverImage() {
}
const attachment = task.attachments.find(a => a.id === task.coverImageAttachmentId)
if (!attachment || !SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.endsWith(suffix))) {
if (!attachment || !SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.toLowerCase().endsWith(suffix))) {
return
}