fix(useMermaidFixTool): add missing dependency to useEffect hook

Add setError to the dependency array to prevent stale closure issues
This commit is contained in:
icarus 2025-10-22 06:21:35 +08:00
parent 8ba48d9df0
commit 55b63d345e

View File

@ -150,7 +150,7 @@ export const useMermaidFixTool = ({ enabled, context, onSave, setError, setTools
}
setPending(blockId, false)
}, [setPending, blockId, completion, prompt, onSave, t])
}, [setPending, blockId, completion, prompt, t, onSave, setError])
// when unmounted
useEffect(() => {