From c6dd3076c54ca291e998773814b735fc25ec864a Mon Sep 17 00:00:00 2001 From: papapatrick <109422393+Patrickill@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:41:21 +0800 Subject: [PATCH] fix: quote display error (#2298) --- .../chat/ChatContainer/ChatBox/components/ResponseTags.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ResponseTags.tsx b/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ResponseTags.tsx index bc731d93f..1ccbe6a8c 100644 --- a/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ResponseTags.tsx +++ b/projects/app/src/components/core/chat/ChatContainer/ChatBox/components/ResponseTags.tsx @@ -12,6 +12,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon'; import { useSystem } from '@fastgpt/web/hooks/useSystem'; import { ChatSiteItemType } from '@fastgpt/global/core/chat/type'; import { addStatisticalDataToHistoryItem } from '@/global/core/chat/utils'; +import { useSize } from 'ahooks'; const QuoteModal = dynamic(() => import('./QuoteModal')); const ContextModal = dynamic(() => import('./ContextModal')); @@ -55,6 +56,7 @@ const ResponseTags = ({ onOpen: onOpenContextModal, onClose: onCloseContextModal } = useDisclosure(); + useSize(quoteListRef); const quoteIsOverflow = quoteListRef.current ? quoteListRef.current.scrollHeight > (isPc ? 50 : 55) : true; @@ -84,7 +86,7 @@ const ResponseTags = ({ <> - {' '} + {quoteFolded && quoteIsOverflow && (