From ebb53dcd569645da63dc81f20be52ffa80e1f675 Mon Sep 17 00:00:00 2001 From: Sarath Nair <91882341+sarath-nair-sonarsource@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:38:01 +0200 Subject: [PATCH] NO-JIRA Fix updation of secured form field (#11599) --- .../authentication/AuthenticationSecuredField.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/settings/components/authentication/AuthenticationSecuredField.tsx b/server/sonar-web/src/main/js/apps/settings/components/authentication/AuthenticationSecuredField.tsx index 597c43a89cc..0487d91f586 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/authentication/AuthenticationSecuredField.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/authentication/AuthenticationSecuredField.tsx @@ -34,13 +34,12 @@ interface SamlToggleFieldProps { export default function AuthenticationSecuredField(props: SamlToggleFieldProps) { const { settingValue, definition, optional = true, isNotSet } = props; - const [showSecretField, setShowSecretField] = React.useState( - !isNotSet && isSecuredDefinition(definition), - ); + const isSecured = isSecuredDefinition(definition); + const [showSecretField, setShowSecretField] = React.useState(!isNotSet && isSecured); useEffect(() => { - setShowSecretField(!isNotSet && isSecuredDefinition(definition)); - }, [isNotSet, definition]); + setShowSecretField(!isNotSet && isSecured); + }, [isNotSet, isSecured]); return ( <> -- 2.39.5