From 53f2a80ced87169b4319ec13e4a7b00df7649c1b Mon Sep 17 00:00:00 2001 From: The Ghost of FOSS' Future <163201376+sneedgroup-holder@users.noreply.github.com> Date: Tue, 17 Sep 2024 19:11:54 -0500 Subject: [PATCH] Update index.html --- index.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index e0a5f03..ed54df5 100644 --- a/index.html +++ b/index.html @@ -333,13 +333,17 @@ }; function quickSaveFile(content) { - const fileName = prompt("File name to quick save as:", `${currentFile}`) || `${currentFile}`; - const blob = new Blob([content], { type: "text/plain" }); - const a = document.createElement("a"); - a.href = URL.createObjectURL(blob); - a.download = fileName; - a.click(); - URL.revokeObjectURL(a.href); + const fileName = prompt("File name to quick save as:", `${currentFile}`); + if (fileName) { + const blob = new Blob([content], { type: "text/plain" }); + const a = document.createElement("a"); + a.href = URL.createObjectURL(blob); + a.download = fileName; + a.click(); + URL.revokeObjectURL(a.href); + } else { + alert("No filename provided. Canceling save...") + } } async function saveAs(content) {