better handle filename prompt

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
This commit is contained in:
Karun 2023-04-15 07:53:14 -04:00 committed by GitHub
parent bb12418e66
commit df883feb45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -534,8 +534,8 @@ export class ComfyUI {
let filename = "workflow.json"; let filename = "workflow.json";
if (promptFilename.value) { if (promptFilename.value) {
filename = prompt("Save workflow as:", filename); filename = prompt("Save workflow as:", filename);
if (filename === null) return; if (!filename) return;
if (!filename.endsWith(".json")) { if (!filename.toLowerCase().endsWith(".json")) {
filename += ".json"; filename += ".json";
} }
} }