]> source.dussan.org Git - sonarqube.git/commitdiff
NO-JIRA Fix updation of secured form field (#11599)
authorSarath Nair <91882341+sarath-nair-sonarsource@users.noreply.github.com>
Fri, 23 Aug 2024 13:38:01 +0000 (15:38 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 23 Aug 2024 20:02:34 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/settings/components/authentication/AuthenticationSecuredField.tsx

index 597c43a89cc034b377610670f38089ae6fa4d69e..0487d91f5860b98f6a19e3a929e00b3527485b77 100644 (file)
@@ -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 (
     <>