Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

Joelaa5ca90f00d5
diff --git a/web/app/components/app/text-generate/item/index.tsx b/web/app/components/app/text-generate/item/index.tsx
index c3086bc829b..e8b98e554d3 100644
--- a/web/app/components/app/text-generate/item/index.tsx
+++ b/web/app/components/app/text-generate/item/index.tsx
@@ -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' />