Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

hotfix: Fixed tags not updating in real time in the label management of apps #15113 (#15110)

Jimmiaxiecd7cb19aee6b
diff --git a/web/app/components/base/tag-management/selector.tsx b/web/app/components/base/tag-management/selector.tsx
index 01e9eb162f5..4fdb2c2d8d1 100644
--- a/web/app/components/base/tag-management/selector.tsx
+++ b/web/app/components/base/tag-management/selector.tsx
@@ -16,7 +16,7 @@ import Checkbox from '@/app/components/base/checkbox'
import { bindTag, createTag, fetchTagList, unBindTag } from '@/service/tag'
import { ToastContext } from '@/app/components/base/toast'
-interface TagSelectorProps {
+type TagSelectorProps = {
targetID: string
isPopover?: boolean
position?: 'bl' | 'br'
@@ -215,6 +215,7 @@ const TagSelector: FC<TagSelectorProps> = ({
}) => {
const { t } = useTranslation()
+ const tagList = useTagStore(s => s.tagList)
const setTagList = useTagStore(s => s.setTagList)
const getTagList = async () => {
@@ -224,9 +225,9 @@ const TagSelector: FC<TagSelectorProps> = ({
const triggerContent = useMemo(() => {
if (selectedTags?.length)
- return selectedTags.map(tag => tag.name).join(', ')
+ return selectedTags.filter(selectedTag => tagList.find(tag => tag.id === selectedTag.id)).map(tag => tag.name).join(', ')
return ''
- }, [selectedTags])
+ }, [selectedTags, tagList])
const Trigger = () => {
return (