mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): disable append paragraph in shared page editor (#8191)
Disable append paragraph function for readonly or shared page editor. ### Before 
This commit is contained in:
@@ -164,11 +164,12 @@ export const BlocksuiteEditorContainer = forwardRef<
|
||||
]);
|
||||
|
||||
const handleClickPageModeBlank = useCallback(() => {
|
||||
if (shared || page.readonly) return;
|
||||
affineEditorContainerProxy.host?.std.command.exec(
|
||||
'appendParagraph' as never,
|
||||
{}
|
||||
);
|
||||
}, [affineEditorContainerProxy]);
|
||||
}, [affineEditorContainerProxy, page, shared]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -223,7 +223,11 @@ export const BlocksuiteDocEditor = forwardRef<
|
||||
specs={specs}
|
||||
hasViewport={false}
|
||||
/>
|
||||
<div className={styles.docEditorGap} onClick={onClickBlank}></div>
|
||||
<div
|
||||
className={styles.docEditorGap}
|
||||
data-testid="page-editor-blank"
|
||||
onClick={onClickBlank}
|
||||
></div>
|
||||
{!shared && displayBiDirectionalLink ? (
|
||||
<BiDirectionalLinkPanel />
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user