updating next tick, trying to filter

This commit is contained in:
sanjayk03-dev
2024-01-22 01:07:02 +05:30
parent 8a6f6f551e
commit 293e1f7420
2 changed files with 19 additions and 11 deletions

View File

@@ -55,17 +55,18 @@ module.exports = {
});
const text = (await response.text()).split(" ").join("\n");
console.log(text);
if (text.length > 20e6) {
this.newGcode[this.tab - 1] = "File is large - gcode view disabled";
} else {
this.newGcode[this.tab - 1] = text;
}
Vue.nextTick(() => {
if (text.length > 20e6) {
this.newGcode[this.tab - 1] = "File is large - gcode view disabled";
} else {
this.newGcode[this.tab - 1] = text;
}
});
} else {
this.newGcode = "";
Vue.nextTick(() => {
this.newGcode[this.tab - 1] = "";
});
}
Vue.nextTick(() => {
console.log("updated");
});
},
upload: function (e) {
const files = e.target.files || e.dataTransfer.files;
@@ -158,6 +159,13 @@ module.exports = {
document.getElementById(`gcodeSelect-${this.tab - 1}`).value = "default";
this.newGcode[this.tab - 1] = "";
},
macrosList: function () {
const macros = this.state.files.filter(
(name) => !this.config.macros.some((obj) => obj.name === name)
);
console.log("Only Macros: ", macros);
return macros;
},
resetConfig: async function () {
this.config.macros = [
{