From a558ed524154ccef63a56c8335b6984a16a78bd5 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 25 Oct 2026 18:03:31 -0500 Subject: don't rely on state for passing data --- src/web/src/components/System/Options/EditModal.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Options/EditModal.jsx b/src/web/src/components/System/Options/EditModal.jsx index 6fc2af69..79fa4332 100644 --- a/src/web/src/components/System/Options/EditModal.jsx +++ b/src/web/src/components/System/Options/EditModal.jsx @@ -43,6 +43,7 @@ const EditModal = ({ onClose, open, theme }) => { const validate = async (newYaml) => { const response = await validateYaml({ yaml: newYaml }); setYamlError(response); + return response; }; const update = async (newYaml) => { @@ -51,14 +52,14 @@ const EditModal = ({ onClose, open, theme }) => { }; const save = async (newYaml) => { - await validate(newYaml); + const validationError = await validate(newYaml); - if (!yamlError) { + if (!validationError) { try { await updateYaml({ yaml: newYaml }); onClose(); } catch (nextUpdateError) { - setUpdateError(nextUpdateError.response.data); + setUpdateError(nextUpdateError?.response?.data ?? nextUpdateError?.message); } } }; -- cgit v1.2.3