Skip to content

Commit

Permalink
Merge branch 'feat/workflow-continue-on-error' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh committed Dec 5, 2024
2 parents d2c88fa + 31128ef commit 0527005
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { useUpdateNodeInternals } from 'reactflow'
import { NodeSourceHandle } from '../node-handle'
import { ErrorHandleTypeEnum } from './types'
import type { Node } from '@/app/components/workflow/types'
Expand All @@ -12,6 +14,12 @@ const ErrorHandleOnNode = ({
}: ErrorHandleOnNodeProps) => {
const { t } = useTranslation()
const { error_strategy } = data
const updateNodeInternals = useUpdateNodeInternals()

useEffect(() => {
if (error_strategy === ErrorHandleTypeEnum.failBranch)
updateNodeInternals(id)
}, [error_strategy, id, updateNodeInternals])

if (!error_strategy)
return null
Expand Down

0 comments on commit 0527005

Please sign in to comment.