1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(edge): generate token when loading settings [EE-2988] (#6792)

This commit is contained in:
Chaim Lev-Ari 2022-04-21 19:18:42 +03:00 committed by GitHub
parent ace162ec1c
commit 5289e4d66b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@ interface FormValues {
TrustOnFirstConnect: boolean;
}
const validation = yup.object({
TrustOnFirstConnect: yup.boolean().required('This field is required.'),
TrustOnFirstConnect: yup.boolean(),
EdgePortainerUrl: yup
.string()
.test(
@ -63,10 +63,10 @@ export function AutoEnvCreationSettingsForm({ settings }: Props) {
);
useEffect(() => {
if (!url && validation.isValidSync({ url: defaultUrl })) {
handleSubmit({ EdgePortainerUrl: defaultUrl });
if (!url && validation.isValidSync({ EdgePortainerUrl: defaultUrl })) {
updateSettings({ EdgePortainerUrl: defaultUrl });
}
}, [handleSubmit, url]);
}, [updateSettings, url]);
return (
<Formik<FormValues>