mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: error catch (#181)
This commit is contained in:
@@ -81,7 +81,9 @@ export const CommandMenu = ({ editor, hooks, style }: CommandMenuProps) => {
|
||||
const checkIfShowCommandMenu = useCallback(
|
||||
async (event: React.KeyboardEvent<HTMLDivElement>) => {
|
||||
const { type, anchorNode } = editor.selection.currentSelectInfo;
|
||||
// console.log(await editor.getBlockById(anchorNode.id));
|
||||
if (!anchorNode?.id) {
|
||||
return;
|
||||
}
|
||||
const activeBlock = await editor.getBlockById(anchorNode.id);
|
||||
if (activeBlock.type === Protocol.Block.Type.page) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user