From fa4a1c52139aec0b312755093656836fedfce4f7 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Wed, 29 Nov 2023 11:55:45 +0300 Subject: [PATCH] Client:OAuth2: fix form validation --- .../OAuth/sub-components/ClientForm/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/index.tsx b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/index.tsx index 36da4521b7..c67b0d0578 100644 --- a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/index.tsx +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/index.tsx @@ -208,11 +208,11 @@ const ClientForm = ({ ) { isValid = false; - nameTimer.current = setTimeout(() => { + return (nameTimer.current = setTimeout(() => { setErrorFields((value) => { return [...value, key]; }); - }, 300); + }, 300)); } if ( @@ -224,8 +224,12 @@ const ClientForm = ({ }); if (nameTimer.current) clearTimeout(nameTimer.current); nameTimer.current = null; + + return; } + isValid = !errorFields.includes(key); + break; } } @@ -271,6 +275,8 @@ const ClientForm = ({ nameTimer.current = null; } + isValid = errorFields.includes(key); + break; case "logo": isValid = isValid && !!form[key];