From 0e9893fcb685627cc692ca5f789db9fbad89d055 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 9 Jun 2021 13:12:56 +0200 Subject: [PATCH] Fix create save modal Fix the wrong variable being passed as mapSettings and clear the form after successfully creating the save. --- packages/web_ui/src/components/CreateSaveModal.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web_ui/src/components/CreateSaveModal.jsx b/packages/web_ui/src/components/CreateSaveModal.jsx index f067635b..10907779 100644 --- a/packages/web_ui/src/components/CreateSaveModal.jsx +++ b/packages/web_ui/src/components/CreateSaveModal.jsx @@ -43,7 +43,7 @@ export default function CreateSaveModal(props) { } if (values.mapSettings && values.mapSettings.trim()) { try { - mapSettings = JSON.parse(values.mapGenSettings); + mapSettings = JSON.parse(values.mapSettings); } catch (err) { form.setFields([{ name: "mapSettings", errors: [err.message] }]); return; @@ -59,6 +59,7 @@ export default function CreateSaveModal(props) { map_gen_settings: mapGenSettings, map_settings: mapSettings, }).then(() => { + form.resetFields(); setVisible(false); }).catch( notifyErrorHandler("Error creating save")