bug fix in save_macro
This commit is contained in:
@@ -224,6 +224,12 @@ module.exports = {
|
|||||||
var macrosName = document.getElementById(`macros-name`).value;
|
var macrosName = document.getElementById(`macros-name`).value;
|
||||||
var macrosColor = document.getElementById("macros-color").value;
|
var macrosColor = document.getElementById("macros-color").value;
|
||||||
var macrosAlert = this.isChecked;
|
var macrosAlert = this.isChecked;
|
||||||
|
|
||||||
|
if (this.fileName != "default" && !this.state.macros_list.map(item => item.file_name).includes(this.fileName)) {
|
||||||
|
this.fileName = "default";
|
||||||
|
this.newGcode = "";
|
||||||
|
}
|
||||||
|
|
||||||
const macros = [...this.state.macros];
|
const macros = [...this.state.macros];
|
||||||
macros.splice(this.tab - 1, 1);
|
macros.splice(this.tab - 1, 1);
|
||||||
const macros_list = macros.map(item => item.name);
|
const macros_list = macros.map(item => item.name);
|
||||||
@@ -406,7 +412,7 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
this.config.macros = [...this.state.macros];
|
this.config.macros = [...this.state.macros];
|
||||||
this.config.macros.push(newMacros);
|
this.config.macros.push(newMacros);
|
||||||
this.tab = this.state.macros.length + 1;
|
this.tab = this.state.macros.length;
|
||||||
this.load_macro();
|
this.load_macro();
|
||||||
this.addMacros = false;
|
this.addMacros = false;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user