Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions web/app/components/base/tag-management/selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 () => {
Expand All @@ -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 (
Expand Down
Loading