gcode clear when cancel, fixed alert box while reset
This commit is contained in:
@@ -79,12 +79,12 @@ module.exports = {
|
||||
this.config.macros[id].color = macrosColor;
|
||||
this.config.macros[id].gcode_file_name = this.state.selected;
|
||||
this.config.macros[id].gcode_file_time = this.state.selected_time;
|
||||
|
||||
console.log(this.config.macros);
|
||||
try {
|
||||
await api.put("config/save", this.config);
|
||||
console.log("Successfully saved");
|
||||
this.$dispatch("update");
|
||||
this.cancelMacros();
|
||||
} catch (error) {
|
||||
console.error("Restore Failed: ", error);
|
||||
alert("Restore failed");
|
||||
@@ -93,6 +93,7 @@ module.exports = {
|
||||
cancelMacros: function (id) {
|
||||
document.getElementById(`macros-name-${id}`).value = "";
|
||||
document.getElementById(`macros-color-${id}`).value = "#ffffff";
|
||||
this.$broadcast("gcode-clear");
|
||||
},
|
||||
resetConfig: async function () {
|
||||
this.config.macros = [
|
||||
|
||||
Reference in New Issue
Block a user