aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-25 18:03:31 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-25 18:03:31 -0500
commita558ed524154ccef63a56c8335b6984a16a78bd5 (patch)
tree6763500f99d8b00baa8c944c976bb218b2db30d9 /src/web
parent600b0b5d484c4c6959f2d527a2c77e3faa1f28ef (diff)
downloadslskd-a558ed524154ccef63a56c8335b6984a16a78bd5.tar.gz
don't rely on state for passing data
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/System/Options/EditModal.jsx7
1 files changed, 4 insertions, 3 deletions
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);
}
}
};