Fix default filename logic

This commit is contained in:
Laetitia (O-01-67) 2022-11-24 11:31:35 -05:00 committed by GitHub
parent 03e0ef00bf
commit 77cd7f8c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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,
}
}