fix: has value not set border

This commit is contained in:
Joel 2025-04-24 18:32:54 +08:00
parent 0fa497499e
commit 10dd237ec0

View File

@ -90,6 +90,11 @@ const BaseNode: FC<BaseNodeProps> = ({
} }
}, [data.isInLoop, data.selected, id, handleNodeLoopChildSizeChange]) }, [data.isInLoop, data.selected, id, handleNodeLoopChildSizeChange])
const workflowStore = useWorkflowStore()
const {
hasNodeInspectVars,
} = workflowStore.getState()
const hasVarValue = hasNodeInspectVars(id)
const showSelectedBorder = data.selected || data._isBundled || data._isEntering const showSelectedBorder = data.selected || data._isBundled || data._isEntering
const { const {
showRunningBorder, showRunningBorder,
@ -99,7 +104,7 @@ const BaseNode: FC<BaseNodeProps> = ({
} = useMemo(() => { } = useMemo(() => {
return { return {
showRunningBorder: data._runningStatus === NodeRunningStatus.Running && !showSelectedBorder, showRunningBorder: data._runningStatus === NodeRunningStatus.Running && !showSelectedBorder,
showSuccessBorder: data._runningStatus === NodeRunningStatus.Succeeded && !showSelectedBorder, showSuccessBorder: (data._runningStatus === NodeRunningStatus.Succeeded || hasVarValue) && !showSelectedBorder,
showFailedBorder: data._runningStatus === NodeRunningStatus.Failed && !showSelectedBorder, showFailedBorder: data._runningStatus === NodeRunningStatus.Failed && !showSelectedBorder,
showExceptionBorder: data._runningStatus === NodeRunningStatus.Exception && !showSelectedBorder, showExceptionBorder: data._runningStatus === NodeRunningStatus.Exception && !showSelectedBorder,
} }
@ -129,11 +134,6 @@ const BaseNode: FC<BaseNodeProps> = ({
return null return null
}, [data._loopIndex, data._runningStatus, t]) }, [data._loopIndex, data._runningStatus, t])
const workflowStore = useWorkflowStore()
const {
hasNodeInspectVars,
} = workflowStore.getState()
return ( return (
<div <div
className={cn( className={cn(
@ -271,7 +271,7 @@ const BaseNode: FC<BaseNodeProps> = ({
) )
} }
{ {
(data._runningStatus === NodeRunningStatus.Succeeded || hasNodeInspectVars(id)) && ( (data._runningStatus === NodeRunningStatus.Succeeded || hasVarValue) && (
<RiCheckboxCircleFill className='h-3.5 w-3.5 text-text-success' /> <RiCheckboxCircleFill className='h-3.5 w-3.5 text-text-success' />
) )
} }