From bba9e79e594049430d75163a4b23921d7d981405 Mon Sep 17 00:00:00 2001 From: fundon Date: Thu, 19 Sep 2024 01:37:18 +0000 Subject: [PATCH] fix(core): override LinkedDocBlockComponent initial state (#8253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstreams: https://github.com/toeverything/blocksuite/pull/8354
🎥 Video uploaded on Graphite:
--- .../block-suite-editor/specs/custom/spec-patchers.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 2d8ffbe559..3a136d288b 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 @@ -484,10 +484,12 @@ export function patchEdgelessClipboard() { } @customElement('affine-linked-doc-ref-block') -// @ts-expect-error ignore private warning for overriding _load export class LinkedDocBlockComponent extends EmbedLinkedDocBlockComponent { - override async _load() { - this.isBannerEmpty = true; + override getInitialState() { + return { + loading: false, + isBannerEmpty: true, + }; } }