| | |
| | | type Params = { |
| | | nodeId: string |
| | | isInIteration: boolean |
| | | isInLoop: boolean |
| | | } |
| | | const useIsVarFileAttribute = ({ |
| | | nodeId, |
| | | isInIteration, |
| | | isInLoop, |
| | | }: Params) => { |
| | | const isChatMode = useIsChatMode() |
| | | const store = useStoreApi() |
| | |
| | | } = store.getState() |
| | | const currentNode = getNodes().find(n => n.id === nodeId) |
| | | const iterationNode = isInIteration ? getNodes().find(n => n.id === currentNode!.parentId) : null |
| | | const loopNode = isInLoop ? getNodes().find(n => n.id === currentNode!.parentId) : null |
| | | const availableNodes = useMemo(() => { |
| | | return getBeforeNodesInSameBranch(nodeId) |
| | | }, [getBeforeNodesInSameBranch, nodeId]) |
| | |
| | | return false |
| | | const parentVariable = variable.slice(0, 2) |
| | | const varType = getCurrentVariableType({ |
| | | parentNode: isInIteration ? iterationNode : loopNode, |
| | | parentNode: iterationNode, |
| | | valueSelector: parentVariable, |
| | | availableNodes, |
| | | isChatMode, |