From e69260defa3c18273798fa91c350c0dbeac30bfe Mon Sep 17 00:00:00 2001 From: icarus Date: Wed, 22 Oct 2025 07:21:30 +0800 Subject: [PATCH] refactor(CodeBlock): add todo comment for future improvement The event form cannot obtain handler completion status via promise. Plan to use useContext for topicId and useEditCodeBlock for editing. --- src/renderer/src/pages/home/Markdown/CodeBlock.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx index 321da3c265..209c44f577 100644 --- a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx +++ b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx @@ -36,6 +36,8 @@ const CodeBlock: React.FC = ({ children, className, node, blockId }) => { const handleSave = useCallback( async (newContent: string) => { if (id !== undefined) { + // The event form cannot obtain the completion status of the handler via a promise. + // TODO: Use useContext to get topicId, use useEditCodeBlock to edit code block. EventEmitter.emit(EVENT_NAMES.EDIT_CODE_BLOCK, { msgBlockId: blockId, codeBlockId: id,