mirror of
https://github.com/portainer/portainer.git
synced 2025-07-27 17:29:39 +02:00
fix(edge): generate token when loading settings [EE-2988] (#6792)
This commit is contained in:
parent
ace162ec1c
commit
5289e4d66b
1 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ interface FormValues {
|
||||||
TrustOnFirstConnect: boolean;
|
TrustOnFirstConnect: boolean;
|
||||||
}
|
}
|
||||||
const validation = yup.object({
|
const validation = yup.object({
|
||||||
TrustOnFirstConnect: yup.boolean().required('This field is required.'),
|
TrustOnFirstConnect: yup.boolean(),
|
||||||
EdgePortainerUrl: yup
|
EdgePortainerUrl: yup
|
||||||
.string()
|
.string()
|
||||||
.test(
|
.test(
|
||||||
|
@ -63,10 +63,10 @@ export function AutoEnvCreationSettingsForm({ settings }: Props) {
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!url && validation.isValidSync({ url: defaultUrl })) {
|
if (!url && validation.isValidSync({ EdgePortainerUrl: defaultUrl })) {
|
||||||
handleSubmit({ EdgePortainerUrl: defaultUrl });
|
updateSettings({ EdgePortainerUrl: defaultUrl });
|
||||||
}
|
}
|
||||||
}, [handleSubmit, url]);
|
}, [updateSettings, url]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik<FormValues>
|
<Formik<FormValues>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue