fix: copy inspect variable value get extra quotes (#21680)
This commit is contained in:
@@ -63,6 +63,17 @@ const Right = ({
|
|||||||
resetConversationVar(currentNodeVar.var.id)
|
resetConversationVar(currentNodeVar.var.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getCopyContent = () => {
|
||||||
|
const value = currentNodeVar?.var.value
|
||||||
|
if (value === null || value === undefined)
|
||||||
|
return ''
|
||||||
|
|
||||||
|
if (typeof value === 'object')
|
||||||
|
return JSON.stringify(value)
|
||||||
|
|
||||||
|
return String(value)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex h-full flex-col')}>
|
<div className={cn('flex h-full flex-col')}>
|
||||||
{/* header */}
|
{/* header */}
|
||||||
@@ -124,7 +135,7 @@ const Right = ({
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{currentNodeVar.var.value_type !== 'secret' && (
|
{currentNodeVar.var.value_type !== 'secret' && (
|
||||||
<CopyFeedback content={currentNodeVar.var.value ? JSON.stringify(currentNodeVar.var.value) : ''} />
|
<CopyFeedback content={getCopyContent()} />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
Reference in New Issue
Block a user