add description length check

This commit is contained in:
JzoNg 2025-08-12 15:54:17 +08:00 committed by QuantumGhost
parent 874406d934
commit d2f12037da
1 changed files with 4 additions and 2 deletions

View File

@ -235,11 +235,13 @@ const ChatVariableModal = ({
return
if (!chatVar && varList.some(chatVar => chatVar.name === name))
return notify({ type: 'error', message: 'name is existed' })
// if (type !== ChatVarType.Object && !value)
// return notify({ type: 'error', message: 'value can not be empty' })
if (type === ChatVarType.Object && objectValue.some(item => !item.key && !!item.value))
return notify({ type: 'error', message: 'object key can not be empty' })
if (description.length > 256)
return notify({ type: 'error', message: 'description can not be longer than 256 characters' })
onSave({
id: chatVar ? chatVar.id : uuid4(),
name,