This commit is contained in:
sanjayk03-dev
2024-05-04 04:28:25 +05:30
parent d6ff117f62
commit 78f200064b

View File

@@ -418,6 +418,7 @@ module.exports = {
}, },
upload_files: async function (files, folderName) { upload_files: async function (files, folderName) {
this.update_config();
for (let file of files) { for (let file of files) {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = () => { reader.onload = () => {
@@ -496,6 +497,7 @@ module.exports = {
}; };
reader.readAsText(file, "utf-8"); reader.readAsText(file, "utf-8");
} }
this.save_config();
}, },
upload_file: async function (e) { upload_file: async function (e) {
@@ -509,9 +511,7 @@ module.exports = {
this.totalFiles = files.length; this.totalFiles = files.length;
this.update_config();
this.upload_files(files); this.upload_files(files);
this.save_config();
}, },
upload_gcode: async function (filename, file) { upload_gcode: async function (filename, file) {
@@ -569,17 +569,15 @@ module.exports = {
upload_folder: async function (e) { upload_folder: async function (e) {
this.uploadFiles = true; this.uploadFiles = true;
this.filesUploaded = 0; this.filesUploaded = 0;
const files = e.target.files || e.dataTransfer.files; const files = e.target.files || e.dataTransfer.files;
if (!files.length) { if (!files.length) {
return; return;
} }
this.totalFiles = files.length; this.totalFiles = files.length;
const folderName = files[0].webkitRelativePath.split("/")[0]; const folderName = files[0].webkitRelativePath.split("/")[0];
this.update_config();
this.upload_files(files, folderName); this.upload_files(files, folderName);
this.save_config();
}, },
delete_current: async function () { delete_current: async function () {