bug fix in file_delete
This commit is contained in:
@@ -23,6 +23,7 @@ module.exports = {
|
|||||||
macrosName: "",
|
macrosName: "",
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
macroFoundName: "",
|
macroFoundName: "",
|
||||||
|
macroFoundGcode: "",
|
||||||
fileName: "default",
|
fileName: "default",
|
||||||
newGcode: "",
|
newGcode: "",
|
||||||
};
|
};
|
||||||
@@ -124,6 +125,8 @@ module.exports = {
|
|||||||
removeFromList: async function () {
|
removeFromList: async function () {
|
||||||
this.config.macros_list = [...this.state.macros_list];
|
this.config.macros_list = [...this.state.macros_list];
|
||||||
this.config.macros_list = this.config.macros_list.filter(item => item.file_name != this.fileName);
|
this.config.macros_list = this.config.macros_list.filter(item => item.file_name != this.fileName);
|
||||||
|
this.config.macros = [...this.state.macros];
|
||||||
|
this.config.macros.filter(item => item.file_name == this.fileName).forEach(item => (item.file_name = "default"));
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
this.$dispatch("update");
|
this.$dispatch("update");
|
||||||
@@ -267,7 +270,8 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
if (macro_with_filename) {
|
if (macro_with_filename) {
|
||||||
this.deleteGCode = false;
|
this.deleteGCode = false;
|
||||||
this.macroFoundName = macro_with_filename.file_name;
|
this.macroFoundName = macro_with_filename.name;
|
||||||
|
this.macroFoundGcode = macro_with_filename.file_name;
|
||||||
this.macroFound = true;
|
this.macroFound = true;
|
||||||
} else {
|
} else {
|
||||||
this.delete_current();
|
this.delete_current();
|
||||||
@@ -280,6 +284,8 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
if (macro_with_filename.length != 0) {
|
if (macro_with_filename.length != 0) {
|
||||||
this.macroFound = false;
|
this.macroFound = false;
|
||||||
|
this.macroFoundName = "";
|
||||||
|
this.macroFoundGcode = "";
|
||||||
macro_with_filename.forEach(item => (item.file_name = "default"));
|
macro_with_filename.forEach(item => (item.file_name = "default"));
|
||||||
}
|
}
|
||||||
if (filename == "default") {
|
if (filename == "default") {
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ script#macros-template(type="text/x-template")
|
|||||||
h3(slot="header") Alert
|
h3(slot="header") Alert
|
||||||
div(slot="body")
|
div(slot="body")
|
||||||
p
|
p
|
||||||
| The file is currently being used by a macro
|
| The file
|
||||||
|
strong {{macroFoundGcode}}
|
||||||
|
| is currently being used by a macro
|
||||||
strong {{macroFoundName}}
|
strong {{macroFoundName}}
|
||||||
| . You need to re-select a file for the macro.
|
| . You need to re-select a file for the macro.
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
|
|||||||
Reference in New Issue
Block a user