Skip to content

Commit a2dea38

Browse files
authored
fix(kb): kb-level deletion should reflect in doc level kb tags sidebar registry (#944)
1 parent 1c3e923 commit a2dea38

File tree

1 file changed

+4
-5
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/knowledge-tags

1 file changed

+4
-5
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/knowledge-tags/knowledge-tags.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ export function KnowledgeTags({ knowledgeBaseId, documentId }: KnowledgeTagsProp
8989
const definition = definitions.find((def) => def.tagSlot === slot)
9090
const currentTag = currentTags?.find((tag) => tag.slot === slot)
9191

92-
// Only include tag if the document actually has a value for it
93-
if (value?.trim()) {
92+
// Only include tag if the document has a value AND a corresponding KB tag definition exists
93+
if (value?.trim() && definition) {
9494
tags.push({
9595
slot,
96-
// Preserve existing displayName if definition is not found yet
97-
displayName: definition?.displayName || currentTag?.displayName || '',
98-
fieldType: definition?.fieldType || currentTag?.fieldType || 'text',
96+
displayName: definition.displayName,
97+
fieldType: definition.fieldType,
9998
value: value.trim(),
10099
})
101100
}

0 commit comments

Comments
 (0)