jusrhee 4 лет назад
Родитель
Сommit
edb527f58a

+ 6 - 7
dashboard/src/components/form-refactor/field-components/Checkbox.tsx

@@ -59,11 +59,10 @@ export const getFinalVariablesForCheckbox: GetFinalVariablesFunction = (
   vars,
   props: CheckboxField
 ) => {
-  return vars[props.variable] === false
-    ? {
-        [props.variable]: false,
-      }
-    : {
-        [props.variable]: !!props.settings?.default,
-      };
+  if (vars[props.variable] === false) {
+    return { [props.variable]: false };
+  } else if (vars[props.variable] === true) {
+    return { [props.variable]: true };
+  } 
+  return { [props.variable]: !!props.settings?.default };
 };

+ 1 - 4
dashboard/src/main/home/launch/launch-flow/SettingsPage.tsx

@@ -149,10 +149,7 @@ class SettingsPage extends Component<PropsType, StateType> {
             isReadOnly={
               !this.props.isAuthorized("namespace", "", ["get", "create"])
             }
-            onSubmit={(val) => {
-              console.log(val)
-              onSubmit(val)
-            }}
+            onSubmit={(val) => onSubmit(val)}
           />
         </>
       );