bug fix in add_macros
This commit is contained in:
@@ -390,11 +390,14 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
add_new_macro: async function () {
|
add_new_macro: async function () {
|
||||||
const length = this.state.macros.length;
|
let length = this.state.macros.length;
|
||||||
if (length >= 20) {
|
if (length >= 20) {
|
||||||
this.maxLimitReached = true;
|
this.maxLimitReached = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
while (this.state.macros.find(item => item.name == `Macro ${length + 1}`)) {
|
||||||
|
length++;
|
||||||
|
}
|
||||||
const newMacros = {
|
const newMacros = {
|
||||||
name: `Macro ${length + 1}`,
|
name: `Macro ${length + 1}`,
|
||||||
color: "#dedede",
|
color: "#dedede",
|
||||||
|
|||||||
Reference in New Issue
Block a user