Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): only enable attachment preview for pdf (#10584)

pengx178e5d7858c48b
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<AttachmentBlockModel> {
static override styles = styles;