From d9b826b3644548357982028dcc6fb128c17427c1 Mon Sep 17 00:00:00 2001 From: CorrectRoadH Date: Thu, 26 Jun 2025 14:22:47 +0800 Subject: [PATCH] chore: add empty tips --- web/app/components/base/tag-input/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/tag-input/index.tsx b/web/app/components/base/tag-input/index.tsx index 3669d84490..c6ddebe2c6 100644 --- a/web/app/components/base/tag-input/index.tsx +++ b/web/app/components/base/tag-input/index.tsx @@ -42,7 +42,12 @@ const TagInput: FC = ({ const handleNewTag = useCallback((value: string) => { const valueTrimmed = value.trim() - if (!valueTrimmed || (items.find(item => item === valueTrimmed))) { + if (!valueTrimmed) { + notify({ type: 'error', message: t('datasetDocuments.segment.keywordEmpty') }) + return + } + + if ((items.find(item => item === valueTrimmed))) { notify({ type: 'error', message: t('datasetDocuments.segment.keywordDuplicate') }) return }