mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 17:39:55 +08:00
fix: hide blockHub in edgeless mode (#1447)
Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
@@ -101,7 +101,10 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
|||||||
if (!editor || !container || !page) {
|
if (!editor || !container || !page) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (page.awarenessStore.getFlag('enable_block_hub')) {
|
if (
|
||||||
|
page.awarenessStore.getFlag('enable_block_hub') &&
|
||||||
|
props.mode === 'page'
|
||||||
|
) {
|
||||||
editor.createBlockHub().then(blockHub => {
|
editor.createBlockHub().then(blockHub => {
|
||||||
if (blockHubRef.current) {
|
if (blockHubRef.current) {
|
||||||
blockHubRef.current.remove();
|
blockHubRef.current.remove();
|
||||||
@@ -118,7 +121,7 @@ export const BlockSuiteEditor = (props: EditorProps) => {
|
|||||||
blockHubRef.current?.remove();
|
blockHubRef.current?.remove();
|
||||||
container.removeChild(editor);
|
container.removeChild(editor);
|
||||||
};
|
};
|
||||||
}, [page]);
|
}, [page, props.mode]);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-testid={`editor-${props.blockSuiteWorkspace.id}-${props.page.id}`}
|
data-testid={`editor-${props.blockSuiteWorkspace.id}-${props.page.id}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user