From 8a0bd83fc43351a99c90d6940a90048afed3bf3a Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Mon, 8 Apr 2024 11:15:47 +0530 Subject: [PATCH] filename bugfix --- src/js/macros.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index 34344b4..27bab2d 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -211,7 +211,7 @@ module.exports = { } }, save_macro: async function () { - if (this.tab == 0 || !this.config.macros[this.tab - 1]) { + if (this.tab == 0 || !this.state.macros[this.tab - 1]) { this.clear_macro(); this.confirmSave = false; return; @@ -234,7 +234,12 @@ module.exports = { return; } - var file_name = this.fileName == "default" ? formattedFilename + ".ngc" : this.fileName; + var file_name = + this.fileName == "default" + ? this.newGcode.trim() != "" + ? formattedFilename + ".ngc" + : "default" + : this.fileName; var file = this.newGcode; if (file.trim() != "") {