fix(web): Hide error message when workflow node error message equals empty string

This commit is contained in:
zhaoying
2026-04-14 16:35:19 +08:00
parent fa1e5ee43c
commit 3c2a78a449

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-24 17:57:08 * @Date: 2026-02-24 17:57:08
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-07 14:05:50 * @Last Modified time: 2026-04-14 16:33:33
*/ */
/* /*
* Runtime Component * Runtime Component
@@ -161,8 +161,7 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({
children: ( children: (
<Flex gap={8} vertical> <Flex gap={8} vertical>
{/* Display error message for failed nodes */} {/* Display error message for failed nodes */}
{vo.content?.error && vo.content?.error !== '' &&
{item.error &&
<RbAlert color="orange" className="rb:pb-0!"> <RbAlert color="orange" className="rb:pb-0!">
<Flex vertical className="rb:w-full!"> <Flex vertical className="rb:w-full!">
<Flex align="center" justify="space-between"> <Flex align="center" justify="space-between">
@@ -219,11 +218,11 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({
</div> </div>
} }
/** Copy value to clipboard and show success message */ /** Copy value to clipboard and show success message */
const handleCopy = (value: string) => { const handleCopy = (value: string) => {
copy(value) copy(value)
message.success(t('common.copySuccess')) message.success(t('common.copySuccess'))
} }
return ( return (
<div <div
@@ -269,7 +268,7 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({
</div> </div>
) )
: <div className="rb:mb-4"> : <div className="rb:mb-4">
{item.error && {item.error && item.error !== '' &&
<RbAlert color="orange" className="rb:pb-0! rb:mb-2!"><Markdown content={item.error} /></RbAlert> <RbAlert color="orange" className="rb:pb-0! rb:mb-2!"><Markdown content={item.error} /></RbAlert>
} }
{renderChild(item.subContent)} {renderChild(item.subContent)}