From 5289e4d66b551a155f96dedbd6c28a548542844d Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Thu, 21 Apr 2022 19:18:42 +0300 Subject: [PATCH] fix(edge): generate token when loading settings [EE-2988] (#6792) --- .../AutoEnvCreationSettingsForm.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx index 13eb46bd2..5cd77788a 100644 --- a/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx +++ b/app/portainer/settings/edge-compute/AutomaticEdgeEnvCreation/AutoEnvCreationSettingsForm.tsx @@ -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 (