From ce37b5a8c365a38003d0dc4e48c8be8a7690627d Mon Sep 17 00:00:00 2001 From: x1a0t <405028157@qq.com> Date: Thu, 9 Mar 2023 15:29:58 +0800 Subject: [PATCH] fix: hide blockHub in edgeless mode (#1447) Co-authored-by: Himself65 --- .../src/components/blocksuite/block-suite-editor/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/blocksuite/block-suite-editor/index.tsx b/apps/web/src/components/blocksuite/block-suite-editor/index.tsx index b826eaa82a..9e442e67b0 100644 --- a/apps/web/src/components/blocksuite/block-suite-editor/index.tsx +++ b/apps/web/src/components/blocksuite/block-suite-editor/index.tsx @@ -101,7 +101,10 @@ export const BlockSuiteEditor = (props: EditorProps) => { if (!editor || !container || !page) { return; } - if (page.awarenessStore.getFlag('enable_block_hub')) { + if ( + page.awarenessStore.getFlag('enable_block_hub') && + props.mode === 'page' + ) { editor.createBlockHub().then(blockHub => { if (blockHubRef.current) { blockHubRef.current.remove(); @@ -118,7 +121,7 @@ export const BlockSuiteEditor = (props: EditorProps) => { blockHubRef.current?.remove(); container.removeChild(editor); }; - }, [page]); + }, [page, props.mode]); return (