fix
This commit is contained in:
parent
f8bd3b13be
commit
1891f5c359
@ -1,6 +1,5 @@
|
|||||||
import ReturnArrow from "@/assets/icons/svg/returnArrow.svg";
|
import ReturnArrow from "@/assets/icons/svg/returnArrow.svg";
|
||||||
import ChatComponent from "@/components/ask/chat";
|
import Chat from "@/components/ask/chat";
|
||||||
import AskHello from "@/components/ask/hello";
|
|
||||||
import { ThemedText } from "@/components/ThemedText";
|
import { ThemedText } from "@/components/ThemedText";
|
||||||
import { fetchApi } from "@/lib/server-api-util";
|
import { fetchApi } from "@/lib/server-api-util";
|
||||||
import { Message } from "@/types/ask";
|
import { Message } from "@/types/ask";
|
||||||
@ -263,7 +262,7 @@ export default function AskScreen() {
|
|||||||
|
|
||||||
<View style={[styles.contentContainer, { marginTop: isHello ? -24 : 0 }]}>
|
<View style={[styles.contentContainer, { marginTop: isHello ? -24 : 0 }]}>
|
||||||
{/* 欢迎页面 */}
|
{/* 欢迎页面 */}
|
||||||
<Animated.View
|
{/* <Animated.View
|
||||||
style={[
|
style={[
|
||||||
styles.absoluteView,
|
styles.absoluteView,
|
||||||
{
|
{
|
||||||
@ -272,12 +271,12 @@ export default function AskScreen() {
|
|||||||
zIndex: 1
|
zIndex: 1
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
>
|
> */}
|
||||||
<AskHello setUserMessages={setUserMessages} setConversationId={setConversationId} setIsHello={setIsHello} />
|
{/* <AskHello setUserMessages={setUserMessages} setConversationId={setConversationId} setIsHello={setIsHello} /> */}
|
||||||
</Animated.View>
|
{/* </Animated.View> */}
|
||||||
|
|
||||||
{/* 聊天页面 */}
|
{/* 聊天页面 */}
|
||||||
<Animated.View
|
{/* <Animated.View
|
||||||
style={[
|
style={[
|
||||||
styles.absoluteView,
|
styles.absoluteView,
|
||||||
{
|
{
|
||||||
@ -286,8 +285,8 @@ export default function AskScreen() {
|
|||||||
zIndex: 0
|
zIndex: 0
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
>
|
> */}
|
||||||
<ChatComponent
|
<Chat
|
||||||
ref={chatListRef}
|
ref={chatListRef}
|
||||||
userMessages={userMessages}
|
userMessages={userMessages}
|
||||||
sessionId={sessionId}
|
sessionId={sessionId}
|
||||||
@ -298,7 +297,7 @@ export default function AskScreen() {
|
|||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
onContentSizeChange={() => scrollToEnd()}
|
onContentSizeChange={() => scrollToEnd()}
|
||||||
/>
|
/>
|
||||||
</Animated.View>
|
{/* </Animated.View> */}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* 输入框区域 */}
|
{/* 输入框区域 */}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ContentPart, Message } from '@/types/ask';
|
import { ContentPart, Message } from '@/types/ask';
|
||||||
import React, { Dispatch, ForwardedRef, SetStateAction, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import React, { Dispatch, ForwardedRef, forwardRef, SetStateAction, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
FlatList,
|
FlatList,
|
||||||
@ -22,7 +22,7 @@ interface ChatProps extends Omit<FlatListProps<Message>, 'data' | 'renderItem'>
|
|||||||
selectedImages: string[];
|
selectedImages: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ChatComponent(
|
function ChatComponent(
|
||||||
{ userMessages, sessionId, setSelectedImages, selectedImages, ...restProps }: ChatProps,
|
{ userMessages, sessionId, setSelectedImages, selectedImages, ...restProps }: ChatProps,
|
||||||
ref: ForwardedRef<FlatList<Message>>
|
ref: ForwardedRef<FlatList<Message>>
|
||||||
) {
|
) {
|
||||||
@ -127,3 +127,5 @@ export default function ChatComponent(
|
|||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default React.memo(forwardRef(ChatComponent));
|
||||||
Loading…
x
Reference in New Issue
Block a user