Explorar el Código

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

tags/1.0.1
Jimmiaxie hace 8 meses
padre
commit
cd7cb19aee
No account linked to committer's email address
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4
    3
      web/app/components/base/tag-management/selector.tsx

+ 4
- 3
web/app/components/base/tag-management/selector.tsx Ver fichero

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'
}) => { }) => {
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 () => {


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 (

Cargando…
Cancelar
Guardar