perf: completion chatId

This commit is contained in:
archer
2023-07-23 20:07:35 +08:00
parent b7d18e38d1
commit 67e10d6f2c
35 changed files with 447 additions and 385 deletions

View File

@@ -19,7 +19,6 @@ import {
getErrText
} from '@/utils/tools';
import { Box, Card, Flex, Input, Textarea, Button, useTheme } from '@chakra-ui/react';
import { useUserStore } from '@/store/user';
import { feConfigs } from '@/store/static';
import { Types } from 'mongoose';
import { EventNameEnum } from '../Markdown/constant';
@@ -118,6 +117,7 @@ const ChatBox = (
showEmptyIntro = false,
chatId,
appAvatar,
userAvatar,
variableModules,
welcomeText,
onUpdateVariable,
@@ -126,7 +126,8 @@ const ChatBox = (
}: {
showEmptyIntro?: boolean;
chatId?: string;
appAvatar: string;
appAvatar?: string;
userAvatar?: string;
variableModules?: VariableItemType[];
welcomeText?: string;
onUpdateVariable?: (e: Record<string, any>) => void;
@@ -142,7 +143,6 @@ const ChatBox = (
const router = useRouter();
const { copyData } = useCopyData();
const { toast } = useToast();
const { userInfo } = useUserStore();
const { isPc } = useGlobalStore();
const TextareaDom = useRef<HTMLTextAreaElement>(null);
const controller = useRef(new AbortController());
@@ -585,7 +585,7 @@ const ChatBox = (
)}
</Flex>
</Box>
<ChatAvatar src={userInfo?.avatar} ml={['6px', 2]} />
<ChatAvatar src={userAvatar} ml={['6px', 2]} />
</>
)}
{item.obj === 'AI' && (