mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-04 11:14:10 +08:00
This commit is contained in:
parent
d84fa4d154
commit
cd7cb19aee
@ -16,7 +16,7 @@ import Checkbox from '@/app/components/base/checkbox'
|
|||||||
import { bindTag, createTag, fetchTagList, unBindTag } from '@/service/tag'
|
import { bindTag, createTag, fetchTagList, unBindTag } from '@/service/tag'
|
||||||
import { ToastContext } from '@/app/components/base/toast'
|
import { ToastContext } from '@/app/components/base/toast'
|
||||||
|
|
||||||
interface TagSelectorProps {
|
type TagSelectorProps = {
|
||||||
targetID: string
|
targetID: string
|
||||||
isPopover?: boolean
|
isPopover?: boolean
|
||||||
position?: 'bl' | 'br'
|
position?: 'bl' | 'br'
|
||||||
@ -215,6 +215,7 @@ const TagSelector: FC<TagSelectorProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
|
const tagList = useTagStore(s => s.tagList)
|
||||||
const setTagList = useTagStore(s => s.setTagList)
|
const setTagList = useTagStore(s => s.setTagList)
|
||||||
|
|
||||||
const getTagList = async () => {
|
const getTagList = async () => {
|
||||||
@ -224,9 +225,9 @@ const TagSelector: FC<TagSelectorProps> = ({
|
|||||||
|
|
||||||
const triggerContent = useMemo(() => {
|
const triggerContent = useMemo(() => {
|
||||||
if (selectedTags?.length)
|
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 ''
|
return ''
|
||||||
}, [selectedTags])
|
}, [selectedTags, tagList])
|
||||||
|
|
||||||
const Trigger = () => {
|
const Trigger = () => {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user