diff --git a/client/src/features/editor/components/block/Block.tsx b/client/src/features/editor/components/block/Block.tsx index 6b4f9f97..e9fdfb9b 100644 --- a/client/src/features/editor/components/block/Block.tsx +++ b/client/src/features/editor/components/block/Block.tsx @@ -102,7 +102,7 @@ export const Block: React.FC = memo( ref={blockRef} onKeyDown={onKeyDown} onInput={handleInput} - onClick={(e) => onClick(block.id)} + onClick={() => onClick(block.id)} contentEditable suppressContentEditableWarning className={textContainerStyle({ diff --git a/client/src/features/editor/hooks/useBlockDragAndDrop.ts b/client/src/features/editor/hooks/useBlockDragAndDrop.ts index 61c35eb9..ae880a5b 100644 --- a/client/src/features/editor/hooks/useBlockDragAndDrop.ts +++ b/client/src/features/editor/hooks/useBlockDragAndDrop.ts @@ -91,7 +91,6 @@ export const useBlockDragAndDrop = ({ setEditorState({ clock: editorCRDT.clock, linkedList: editorCRDT.LinkedList, - currentBlock: editorState.currentBlock, }); } catch (error) { console.error("Failed to reorder blocks:", error); diff --git a/client/src/features/editor/hooks/useMarkdownGrammer.ts b/client/src/features/editor/hooks/useMarkdownGrammer.ts index dcd0e1c7..3a1308f7 100644 --- a/client/src/features/editor/hooks/useMarkdownGrammer.ts +++ b/client/src/features/editor/hooks/useMarkdownGrammer.ts @@ -57,10 +57,10 @@ export const useMarkdownGrammer = ({ ) { editorCRDT.currentBlock = editorCRDT.LinkedList.getNode(newBlockId); } - setEditorState((prev) => ({ + setEditorState({ clock: editorCRDT.clock, linkedList: editorCRDT.LinkedList, - })); + }); }; const currentBlockId = editorCRDT.currentBlock ? editorCRDT.currentBlock.id : null;