diff --git a/src/js/macros.js b/src/js/macros.js index 8b30acf..de40547 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -286,7 +286,10 @@ module.exports = { this.macroFound = false; this.macroFoundName = ""; this.macroFoundGcode = ""; - macro_with_filename.forEach(item => (item.file_name = "default")); + macro_with_filename.forEach(item => { + console.log(item.name); + item.file_name = "default"; + }); } if (filename == "default") { this.newGcode = ""; @@ -378,7 +381,6 @@ module.exports = { const macros_list = this.state.macros_list.map(item => item.file_name).toString(); api.delete(`file/DINCAIQABiDARixAxiABDIHCAMQABiABDIHCAQQABiABDIH${macros_list}`); this.config.macros_list = []; - this.clear_macro(); this.edited = false; this.confirmReset = false; try { @@ -388,6 +390,7 @@ module.exports = { console.error("Restore Failed: ", error); alert("Restore failed"); } + this.clear_macro(); }, add_new_macro: async function () { let length = this.state.macros.length; diff --git a/src/py/bbctrl/Config.py b/src/py/bbctrl/Config.py index ef82dbf..3b30a74 100644 --- a/src/py/bbctrl/Config.py +++ b/src/py/bbctrl/Config.py @@ -221,7 +221,6 @@ class Config(object): tmpl['template'], with_defaults) else: self.values[name]=value - self.log.info('>> config to state'+name) self.ctrl.state.config(name,value) return