Fix create save modal

Fix the wrong variable being passed as mapSettings and clear the form
after successfully creating the save.
This commit is contained in:
Hornwitser committed 2021-06-10 10:26:40 +02:00
1 parent f37c387d52
commit 0e9893fcb6
1 file changed
+2 -1
@@ -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")