fix: text generation app not show copy button (#4304)

pull/4314/head
Joel 2 years ago committed by GitHub
parent 4af00e4a45
commit aa5ca90f00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -322,16 +322,16 @@ const GenerationItem: FC<IGenerationItemProps> = ({
</SimpleBtn>
)
}
{currentTab === 'RESULT' && (
{(currentTab === 'RESULT' || !isWorkflow) && (
<SimpleBtn
isDisabled={isError || !messageId}
className={cn(isMobile && '!px-1.5', 'space-x-1')}
onClick={() => {
const content = workflowProcessData?.resultText
if (typeof content === 'string')
copy(content)
const copyContent = isWorkflow ? workflowProcessData?.resultText : content
if (typeof copyContent === 'string')
copy(copyContent)
else
copy(JSON.stringify(content))
copy(JSON.stringify(copyContent))
Toast.notify({ type: 'success', message: t('common.actionMsg.copySuccessfully') })
}}>
<Clipboard className='w-3.5 h-3.5' />

Loading…
Cancel
Save