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.
This commit is contained in:
icarus 2025-10-22 07:21:30 +08:00
parent d3d02712a4
commit e69260defa

View File

@ -36,6 +36,8 @@ const CodeBlock: React.FC<Props> = ({ 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,