mirror of
https://github.com/langgenius/dify.git
synced 2026-04-26 10:16:40 +08:00
chore: handle completion acion
This commit is contained in:
parent
50072a63ae
commit
3276d6429d
@ -99,6 +99,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const params = useParams()
|
const params = useParams()
|
||||||
const isTop = depth === 1
|
const isTop = depth === 1
|
||||||
|
const isTryApp = appSourceType === AppSourceType.tryApp
|
||||||
const [completionRes, setCompletionRes] = useState('')
|
const [completionRes, setCompletionRes] = useState('')
|
||||||
const [childMessageId, setChildMessageId] = useState<string | null>(null)
|
const [childMessageId, setChildMessageId] = useState<string | null>(null)
|
||||||
const [childFeedback, setChildFeedback] = useState<FeedbackType>({
|
const [childFeedback, setChildFeedback] = useState<FeedbackType>({
|
||||||
@ -329,13 +330,13 @@ const GenerationItem: FC<IGenerationItemProps> = ({
|
|||||||
<RiReplay15Line className='h-4 w-4' />
|
<RiReplay15Line className='h-4 w-4' />
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
)}
|
)}
|
||||||
{isInWebApp && !isWorkflow && (
|
{isInWebApp && !isWorkflow && !isTryApp && (
|
||||||
<ActionButton disabled={isError || !messageId} onClick={() => { onSave?.(messageId as string) }}>
|
<ActionButton disabled={isError || !messageId} onClick={() => { onSave?.(messageId as string) }}>
|
||||||
<RiBookmark3Line className='h-4 w-4' />
|
<RiBookmark3Line className='h-4 w-4' />
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{(supportFeedback || isInWebApp) && !isWorkflow && !isError && messageId && (
|
{(supportFeedback || isInWebApp) && !isWorkflow && !isTryApp && !isError && messageId && (
|
||||||
<div className='ml-1 flex items-center gap-0.5 rounded-[10px] border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 shadow-md backdrop-blur-sm'>
|
<div className='ml-1 flex items-center gap-0.5 rounded-[10px] border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 shadow-md backdrop-blur-sm'>
|
||||||
{!feedback?.rating && (
|
{!feedback?.rating && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user