@@ -4,14 +4,15 @@ import { BlockPathCalculator } from '@/lib/workflows/blocks/block-path-calculato
44import { SYSTEM_REFERENCE_PREFIXES } from '@/lib/workflows/sanitization/references'
55import { normalizeName } from '@/executor/constants'
66import { useWorkflowStore } from '@/stores/workflows/workflow/store'
7- import type { Loop } from '@/stores/workflows/workflow/types'
7+ import type { Loop , Parallel } from '@/stores/workflows/workflow/types'
88
99export function useAccessibleReferencePrefixes ( blockId ?: string | null ) : Set < string > | undefined {
10- const { blocks, edges, loops } = useWorkflowStore (
10+ const { blocks, edges, loops, parallels } = useWorkflowStore (
1111 useShallow ( ( state ) => ( {
1212 blocks : state . blocks ,
1313 edges : state . edges ,
1414 loops : state . loops || { } ,
15+ parallels : state . parallels || { } ,
1516 } ) )
1617 )
1718
@@ -25,12 +26,12 @@ export function useAccessibleReferencePrefixes(blockId?: string | null): Set<str
2526 const accessibleIds = new Set < string > ( ancestorIds )
2627 accessibleIds . add ( blockId )
2728
28- const loopValues = Object . values ( loops as Record < string , Loop > )
29- loopValues . forEach ( ( loop ) => {
30- if ( ! loop ?. nodes ) return
31- if ( loop . nodes . includes ( blockId ) ) {
32- accessibleIds . add ( loop . id )
33- }
29+ Object . values ( loops as Record < string , Loop > ) . forEach ( ( loop ) => {
30+ if ( loop ?. nodes ?. includes ( blockId ) ) accessibleIds . add ( loop . id )
31+ } )
32+
33+ Object . values ( parallels as Record < string , Parallel > ) . forEach ( ( parallel ) => {
34+ if ( parallel ?. nodes ?. includes ( blockId ) ) accessibleIds . add ( parallel . id )
3435 } )
3536
3637 const prefixes = new Set < string > ( )
@@ -45,5 +46,5 @@ export function useAccessibleReferencePrefixes(blockId?: string | null): Set<str
4546 SYSTEM_REFERENCE_PREFIXES . forEach ( ( prefix ) => prefixes . add ( prefix ) )
4647
4748 return prefixes
48- } , [ blockId , blocks , edges , loops ] )
49+ } , [ blockId , blocks , edges , loops , parallels ] )
4950}
0 commit comments