bug fix in delete_current in macros

This commit is contained in:
sanjayk03-dev
2024-04-10 03:50:37 +05:30
parent 9137441f11
commit b51fe5a10f
2 changed files with 5 additions and 7 deletions

View File

@@ -238,6 +238,7 @@ module.exports = {
}
this.update_config();
const macros = [...this.state.macros];
macros.splice(this.tab - 1, 1);
const macros_list = macros.map(item => item.name);
@@ -305,7 +306,9 @@ module.exports = {
item.file_name = "default";
});
}
api.delete(`file/${filename}`);
if (!this.state.non_macros_list.find(item => item.file_name == filename)) {
api.delete(`file/${filename}`);
}
this.newGcode = "";
this.config.macros_list = this.config.macros_list.filter(item => item.file_name !== filename);
this.fileName = "default";