From 77cd7f8c6760569a9c3da6cd324a247dd6c5ac36 Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Thu, 24 Nov 2022 11:31:35 -0500 Subject: [PATCH] Fix default filename logic --- mods/save_loading.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/save_loading.js b/mods/save_loading.js index 969ea5a4..6bbeb016 100644 --- a/mods/save_loading.js +++ b/mods/save_loading.js @@ -58,7 +58,10 @@ function formatCurrentDate() { //derived from https://gist.github.com/Ivlyth/c49 function savePrompt() { var filename = prompt("Please enter the desired filename, without the .json (defaults to current date)"); if(filename === null) { - filename = `Sandboxels save ${formatCurrentDate()}`; + return false; + }; + if(filename === "") { + filename = `Sandboxels save ${formatCurrentDate()}`; }; filename += ".json"; downloadSave(filename) @@ -226,4 +229,4 @@ elements.save_loader = { excludeRandom: true, color: "#FFFFFF", desc: saveLoaderDescription, -} \ No newline at end of file +}