bug fix in add_macros

This commit is contained in:
sanjayk03-dev
2024-04-08 12:42:47 +05:30
parent 15c0da4336
commit 63b2bf10ee

View File

@@ -390,11 +390,14 @@ module.exports = {
}
},
add_new_macro: async function () {
const length = this.state.macros.length;
let length = this.state.macros.length;
if (length >= 20) {
this.maxLimitReached = true;
return;
}
while (this.state.macros.find(item => item.name == `Macro ${length + 1}`)) {
length++;
}
const newMacros = {
name: `Macro ${length + 1}`,
color: "#dedede",