fix: quote display error (#2298)

This commit is contained in:
papapatrick
2024-08-08 14:41:21 +08:00
committed by GitHub
parent b4f3a77b01
commit c6dd3076c5

View File

@@ -12,6 +12,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
import { useSystem } from '@fastgpt/web/hooks/useSystem'; import { useSystem } from '@fastgpt/web/hooks/useSystem';
import { ChatSiteItemType } from '@fastgpt/global/core/chat/type'; import { ChatSiteItemType } from '@fastgpt/global/core/chat/type';
import { addStatisticalDataToHistoryItem } from '@/global/core/chat/utils'; import { addStatisticalDataToHistoryItem } from '@/global/core/chat/utils';
import { useSize } from 'ahooks';
const QuoteModal = dynamic(() => import('./QuoteModal')); const QuoteModal = dynamic(() => import('./QuoteModal'));
const ContextModal = dynamic(() => import('./ContextModal')); const ContextModal = dynamic(() => import('./ContextModal'));
@@ -55,6 +56,7 @@ const ResponseTags = ({
onOpen: onOpenContextModal, onOpen: onOpenContextModal,
onClose: onCloseContextModal onClose: onCloseContextModal
} = useDisclosure(); } = useDisclosure();
useSize(quoteListRef);
const quoteIsOverflow = quoteListRef.current const quoteIsOverflow = quoteListRef.current
? quoteListRef.current.scrollHeight > (isPc ? 50 : 55) ? quoteListRef.current.scrollHeight > (isPc ? 50 : 55)
: true; : true;
@@ -84,7 +86,7 @@ const ResponseTags = ({
<> <>
<Flex justifyContent={'space-between'} alignItems={'center'}> <Flex justifyContent={'space-between'} alignItems={'center'}>
<Box width={'100%'}> <Box width={'100%'}>
<ChatBoxDivider icon="core/chat/quoteFill" text={t('common:core.chat.Quote')} />{' '} <ChatBoxDivider icon="core/chat/quoteFill" text={t('common:core.chat.Quote')} />
</Box> </Box>
{quoteFolded && quoteIsOverflow && ( {quoteFolded && quoteIsOverflow && (
<MyIcon <MyIcon