fixing state update while upload
This commit is contained in:
@@ -498,6 +498,12 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
SvelteComponents.showDialog("Upload", {
|
||||
file,
|
||||
onComplete: () => {
|
||||
this.last_file_time = undefined; // Force reload
|
||||
// this.$broadcast("gcode-reload", file.name);
|
||||
|
||||
const isAlreadyPresent = this.config.non_macros_list.find(element => element.file_name == file.name);
|
||||
if (!isAlreadyPresent) {
|
||||
this.config.non_macros_list.push({ file_name: file.name });
|
||||
@@ -521,11 +527,6 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
console.log("523", this.config.gcode_list);
|
||||
SvelteComponents.showDialog("Upload", {
|
||||
file,
|
||||
onComplete: () => {
|
||||
this.last_file_time = undefined; // Force reload
|
||||
// this.$broadcast("gcode-reload", file.name);
|
||||
const remaining_files = this.modify_files(files);
|
||||
const updated_event = { ...e };
|
||||
if (updated_event.target) {
|
||||
@@ -572,7 +573,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
delete_folder: async function () {
|
||||
if (this.state.folder) {
|
||||
if (this.state.folder && this.state.folder != "Unorganized files") {
|
||||
console.log("595");
|
||||
const files_to_move = this.config.gcode_list.find(
|
||||
item => item.type == "folder" && item.name == this.state.folder,
|
||||
@@ -596,10 +597,11 @@ module.exports = {
|
||||
this.save_config(this.config);
|
||||
}
|
||||
}
|
||||
this.state.folder = "Unorganized files";
|
||||
this.confirmDelete = false;
|
||||
},
|
||||
delete_folder_and_files: async function () {
|
||||
if (this.state.folder) {
|
||||
if (this.state.folder && this.state.folder != "Unorganized files") {
|
||||
const selected_folder = this.config.gcode_list.find(
|
||||
item => (item.type = "folder" && item.name == this.state.folder),
|
||||
);
|
||||
@@ -618,6 +620,7 @@ module.exports = {
|
||||
this.save_config(this.config);
|
||||
}
|
||||
}
|
||||
this.state.folder = "Unorganized files";
|
||||
this.confirmDelete = false;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user