fix(client): circular function calls leads to memory leak (#1049)

* fix(client): circular function call leads to memory leak

* allow children validation
This commit is contained in:
Murat Dzhulkuttiev 2026-02-03 20:50:50 +03:00 • committed by GitHub
commit 885c8bc732
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,9 +102,11 @@ const ToolsTab = ({
const { copied, setCopied } = useCopy();
// Function to check if any form has validation errors
const checkValidationErrors = () => {
const checkValidationErrors = (validateChildren: boolean = false) => {
const errors = Object.values(formRefs.current).some(
(ref) => ref && !ref.validateJson().isValid,
(ref) =>
ref &&
(validateChildren ? !ref.validateJson().isValid : ref.hasJsonError()),
);
setHasValidationErrors(errors);
return errors;
@ -675,7 +677,7 @@ const ToolsTab = ({
<Button
onClick={async () => {
// Validate JSON inputs before calling tool
if (checkValidationErrors()) return;
if (checkValidationErrors(true)) return;
try {
setIsToolRunning(true);