fix: hide blockHub in edgeless mode (#1447)

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
x1a0t
2023-03-09 15:29:58 +08:00
committed by GitHub
parent 6b533c44be
commit ce37b5a8c3

View File

@@ -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 (
<div
data-testid={`editor-${props.blockSuiteWorkspace.id}-${props.page.id}`}