diff --git a/plugins/chunter-resources/src/components/AttachmentPresenter.svelte b/plugins/chunter-resources/src/components/AttachmentPresenter.svelte index e47495f80b..eb89dfb30b 100644 --- a/plugins/chunter-resources/src/components/AttachmentPresenter.svelte +++ b/plugins/chunter-resources/src/components/AttachmentPresenter.svelte @@ -32,16 +32,20 @@ const ext = parts[parts.length - 1] return ext.substring(0, 4).toUpperCase() } + + function openEmbedded(contentType: string) { + return contentType.includes('application/pdf') || contentType.startsWith('image/') + }
- {#if value.type.includes('application/pdf')} + {#if openEmbedded(value.type)}
{ closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{iconLabel(value.name)}
{:else}
{iconLabel(value.name)}
{/if}
- {#if value.type.includes('application/pdf') || value.type.startsWith('image/')} + {#if openEmbedded(value.type)}
{ closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{trimFilename(value.name)}
{:else}