Commit 062034d5 by Liu

fix:常见问题被压缩&&接口调用多次

parent f30979f3
......@@ -864,10 +864,12 @@ export const Chat: React.FC = () => {
if (isLoading !== undefined) {
setIsLoading(isLoading)
}
// 发送自定义事件到父组件
window.dispatchEvent(new CustomEvent('toolButtonClick', {
detail: { isToolBtn, toolId, toolName, shouldChangeStyle, conversationId },
}))
// 只在真正的工具切换时触发事件(有 conversationId 时),避免 loading 状态更新时重复触发
if (conversationId) {
window.dispatchEvent(new CustomEvent('toolButtonClick', {
detail: { isToolBtn, toolId, toolName, shouldChangeStyle, conversationId },
}))
}
}}
placeholders={[]}
/>
......
......@@ -64,7 +64,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex,
/>
<div
style={{ background: '#F7FAFD' }}
className="rounded-[20px] box-border px-[16px] py-[12px] sm:px-[24px] sm:py-[20px] relative"
className="rounded-[20px] box-border px-[16px] py-[12px] sm:px-[24px] sm:py-[20px] relative flex-1 min-w-0 sm:max-w-[700px] md:max-w-[900px] lg:max-w-[1200px]"
>
{item.answer?.length || item.cardList?.length
? (
......
......@@ -90,7 +90,7 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
}
}, [])
return (
<div className="sm:pl-[62px] mt-[12px] flex flex-col">
<div className="sm:pl-[62px] mt-[12px] flex flex-col sm:max-w-[700px] md:max-w-[900px] lg:max-w-[1200px]">
{!loading && questionList.length !== 0 && questionList.length > 0 && (
<div className="flex flex-col gap-[8px]">
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment