tidy up
This commit is contained in:
parent
189caa6235
commit
335240718c
|
@ -59,14 +59,12 @@
|
||||||
}
|
}
|
||||||
const getAutomationNameError = name => {
|
const getAutomationNameError = name => {
|
||||||
if (stepNames && editing) {
|
if (stepNames && editing) {
|
||||||
// Check against stepNames
|
|
||||||
for (const [key, value] of Object.entries(stepNames)) {
|
for (const [key, value] of Object.entries(stepNames)) {
|
||||||
if (name !== block.name && name === value && key !== block.id) {
|
if (name !== block.name && name === value && key !== block.id) {
|
||||||
return "This name already exists, please enter a unique name"
|
return "This name already exists, please enter a unique name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check against other block names
|
|
||||||
for (const step of allSteps) {
|
for (const step of allSteps) {
|
||||||
if (step.id !== block.id && name === step.name) {
|
if (step.id !== block.id && name === step.name) {
|
||||||
return "This name already exists, please enter a unique name"
|
return "This name already exists, please enter a unique name"
|
||||||
|
|
Loading…
Reference in New Issue