Skip to content

Commit ec64991

Browse files
committed
removed redundant hook
1 parent 8e6b599 commit ec64991

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { getDependsOnFields } from '@/blocks/utils'
3535
import { useMcpServers, useMcpToolsQuery } from '@/hooks/queries/mcp'
3636
import { useCredentialName } from '@/hooks/queries/oauth-credentials'
3737
import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
38-
import { useKnowledgeBaseName } from '@/hooks/use-knowledge-base-name'
38+
import { useKnowledgeBase } from '@/hooks/use-knowledge'
3939
import { useSelectorDisplayName } from '@/hooks/use-selector-display-name'
4040
import { useVariablesStore } from '@/stores/panel/variables/store'
4141
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
@@ -409,11 +409,10 @@ const SubBlockRow = ({
409409
planId: planIdValue,
410410
})
411411

412-
const knowledgeBaseDisplayName = useKnowledgeBaseName(
413-
subBlock?.type === 'knowledge-base-selector' && typeof rawValue === 'string'
414-
? rawValue
415-
: undefined
412+
const { knowledgeBase: kbForDisplayName } = useKnowledgeBase(
413+
subBlock?.type === 'knowledge-base-selector' && typeof rawValue === 'string' ? rawValue : ''
416414
)
415+
const knowledgeBaseDisplayName = kbForDisplayName?.name ?? null
417416

418417
const workflowMap = useWorkflowRegistry((state) => state.workflows)
419418
const workflowSelectionName =

apps/sim/hooks/use-knowledge-base-name.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

apps/sim/hooks/use-knowledge-base-tag-definitions.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@ export function useKnowledgeBaseTagDefinitions(knowledgeBaseId: string | null) {
5757
}
5858
}, [knowledgeBaseId])
5959

60-
const getTagLabel = useCallback(
61-
(tagSlot: string): string => {
62-
const definition = tagDefinitions.find((def) => def.tagSlot === tagSlot)
63-
return definition?.displayName || tagSlot
64-
},
65-
[tagDefinitions]
66-
)
67-
68-
const getTagDefinition = useCallback(
69-
(tagSlot: string): TagDefinition | undefined => {
70-
return tagDefinitions.find((def) => def.tagSlot === tagSlot)
71-
},
72-
[tagDefinitions]
73-
)
74-
75-
// Auto-fetch on mount and when dependencies change
7660
useEffect(() => {
7761
fetchTagDefinitions()
7862
}, [fetchTagDefinitions])
@@ -82,7 +66,5 @@ export function useKnowledgeBaseTagDefinitions(knowledgeBaseId: string | null) {
8266
isLoading,
8367
error,
8468
fetchTagDefinitions,
85-
getTagLabel,
86-
getTagDefinition,
8769
}
8870
}

0 commit comments

Comments
 (0)