fix: sys var not show

This commit is contained in:
Joel 2024-04-01 12:39:54 +08:00
parent e9985f0696
commit 0843af2996
1 changed files with 3 additions and 2 deletions

View File

@ -342,10 +342,11 @@ export const useWorkflow = () => {
setViewport(viewport)
}, [store, reactflow])
const getNode = useCallback((nodeId: string) => {
const getNode = useCallback((nodeId?: string) => {
const { getNodes } = store.getState()
const nodes = getNodes()
return getNodes().find(node => node.id === nodeId)
return nodes.find(node => node.id === nodeId) || nodes.find(node => node.data.type === BlockEnum.Start)
}, [store])
return {