mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 12:51:26 +08:00
fix(CodeToolbar): correct tool cleanup and fix callback invocation
Ensure the correct tool ID is used for cleanup and wrap fixCode in arrow function to maintain context
This commit is contained in:
parent
55b63d345e
commit
63e522bf82
@ -169,10 +169,10 @@ export const useMermaidFixTool = ({ enabled, context, onSave, setError, setTools
|
||||
icon: <WrenchIcon size={'1rem'} className="tool-icon" />,
|
||||
tooltip: t('code_block.mermaid_fix.label'),
|
||||
visible: () => error !== undefined && error !== null,
|
||||
onClick: fixCode
|
||||
onClick: () => fixCode()
|
||||
})
|
||||
}
|
||||
|
||||
return () => removeTool(TOOL_SPECS.expand.id)
|
||||
return () => removeTool(TOOL_SPECS.mermaid_fix.id)
|
||||
}, [enabled, error, fixCode, registerTool, removeTool, t])
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user