diff --git a/src/js/macros.js b/src/js/macros.js index 2301095..8b30acf 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -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",