refactor(chatComponent): simplify conditional statement in Chat component's error handling logic
This commit is contained in:
parent
18b3583850
commit
9b1f86b681
1 changed files with 6 additions and 7 deletions
|
|
@ -93,7 +93,7 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
|
|||
(errors: Array<string>, t) =>
|
||||
errors.concat(
|
||||
(template[t].required && template[t].show) &&
|
||||
(!template[t].value || template[t].value === "") &&
|
||||
(!template[t].value && template[t].value !== false && template[t].value === "") &&
|
||||
!reactFlowInstance
|
||||
.getEdges()
|
||||
.some(
|
||||
|
|
@ -102,12 +102,11 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
|
|||
e.targetHandle.split("|")[2] === n.id
|
||||
)
|
||||
? [
|
||||
`${type} is missing ${
|
||||
template.display_name
|
||||
? template.display_name
|
||||
: snakeToNormalCase(template[t].name)
|
||||
}.`,
|
||||
]
|
||||
`${type} is missing ${template.display_name
|
||||
? template.display_name
|
||||
: snakeToNormalCase(template[t].name)
|
||||
}.`,
|
||||
]
|
||||
: []
|
||||
),
|
||||
[] as string[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue