Commit 54cf870d authored by 金伟强's avatar 金伟强

fix: show intro logic problem

parent efbc8468
......@@ -46,6 +46,7 @@ export type IChatProps = {
suggestionList?: string[]
isShowSpeechToText?: boolean
answerIconClassName?: string
isShowConfigElem?: boolean
}
const Chat: FC<IChatProps> = ({
......@@ -69,6 +70,7 @@ const Chat: FC<IChatProps> = ({
suggestionList,
isShowSpeechToText,
answerIconClassName,
isShowConfigElem,
}) => {
const { t } = useTranslation()
const { notify } = useContext(ToastContext)
......@@ -145,13 +147,11 @@ const Chat: FC<IChatProps> = ({
})
}
const hasChatStart = chatList.some(item => !item.isAnswer)
return (
<div className={cn('px-3.5', 'h-full')}>
{!hasChatStart && (configElem || null)}
{isShowConfigElem && (configElem || null)}
{/* Chat List */}
<div className={cn((!hasChatStart && configElem) ? 'h-0' : 'h-full', 'space-y-[30px]')}>
<div className={cn((isShowConfigElem && configElem) ? 'h-0' : 'h-full', 'space-y-[30px]')}>
{chatList.map((item) => {
if (item.isAnswer) {
const isLast = item.id === chatList[chatList.length - 1].id
......
......@@ -472,7 +472,6 @@ const Main: FC<IMainProps> = () => {
setAbortController(abortController)
},
onData: (message: string, isFirstMessage: boolean, { conversationId: newConversationId, messageId, taskId }: any) => {
// console.log('get message...')
responseItem.content = responseItem.content + message
responseItem.id = messageId
if (isFirstMessage && newConversationId)
......@@ -511,7 +510,6 @@ const Main: FC<IMainProps> = () => {
},
onThought(thought) {
// thought then start to return message
// console.log('thought...');
(responseItem as any).agent_thoughts.push(thought)
},
onError() {
......@@ -626,6 +624,7 @@ const Main: FC<IMainProps> = () => {
)}
<div className={cn((!isNewConversation || isResponsing) && 'pt-[90px]', 'pc:w-[794px] max-w-full mobile:w-full mx-auto h-full overflow-y-auto')} ref={chatListDomRef}>
<Chat
isShowConfigElem={isNewConversation && !chatList.some(item => item.isAnswer)}
configElem={<Init
modelId={modelId}
onModelChange={setModeId}
......
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