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): disable re-rendering of pdf embed view (#9334)

fundon1afdb68143fc
diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx
index 0b2af7822c..26798f5275 100644
--- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx
+++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx
@@ -604,7 +604,10 @@ export function patchForMobile() {
}
export function patchForAttachmentEmbedViews(
- reactToLit: (element: ElementOrFactory) => TemplateResult
+ reactToLit: (
+ element: ElementOrFactory,
+ rerendering?: boolean
+ ) => TemplateResult
): ExtensionType {
return {
setup: di => {
@@ -626,7 +629,8 @@ export function patchForAttachmentEmbedViews(
reactToLit(
<AttachmentPreviewErrorBoundary key={model.id}>
<PDFViewerEmbedded {...buildAttachmentProps(model)} />
- </AttachmentPreviewErrorBoundary>
+ </AttachmentPreviewErrorBoundary>,
+ false
),
}));
},