From 8e5d7858c48b2f143edc1303aa89958912369041 Mon Sep 17 00:00:00 2001 From: pengx17 Date: Mon, 3 Mar 2025 11:07:13 +0000 Subject: [PATCH] fix(core): only enable attachment preview for pdf (#10584) --- blocksuite/affine/block-attachment/src/attachment-block.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blocksuite/affine/block-attachment/src/attachment-block.ts b/blocksuite/affine/block-attachment/src/attachment-block.ts index bdcb7b3579..20b0737ad8 100644 --- a/blocksuite/affine/block-attachment/src/attachment-block.ts +++ b/blocksuite/affine/block-attachment/src/attachment-block.ts @@ -30,7 +30,11 @@ import { AttachmentEmbedProvider } from './embed.js'; import { styles } from './styles.js'; import { checkAttachmentBlob, downloadAttachmentBlob } from './utils.js'; -@Peekable() +@Peekable({ + enableOn: ({ model }: AttachmentBlockComponent) => { + return model.type.endsWith('pdf'); + }, +}) export class AttachmentBlockComponent extends CaptionedBlockComponent { static override styles = styles;