mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00
perf: dynamic
This commit is contained in:
@@ -30,15 +30,14 @@ import { EventNameEnum } from '../Markdown/constant';
|
||||
|
||||
import { adaptChatItem_openAI } from '@/utils/plugin/openai';
|
||||
import { useMarkdown } from '@/hooks/useMarkdown';
|
||||
import { AppModuleItemType, VariableItemType } from '@/types/app';
|
||||
import { SystemInputEnum, VariableInputEnum } from '@/constants/app';
|
||||
import { VariableItemType } from '@/types/app';
|
||||
import { VariableInputEnum } from '@/constants/app';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { MessageItemType } from '@/pages/api/openapi/v1/chat/completions';
|
||||
import { fileDownload } from '@/utils/file';
|
||||
import { htmlTemplate } from '@/constants/common';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useGlobalStore } from '@/store/global';
|
||||
import { FlowModuleTypeEnum } from '@/constants/flow';
|
||||
import { TaskResponseKeyEnum } from '@/constants/chat';
|
||||
|
||||
import MyIcon from '@/components/Icon';
|
||||
|
@@ -9,7 +9,6 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { useSelectFile } from '@/hooks/useSelectFile';
|
||||
import { compressImg } from '@/utils/file';
|
||||
import { getErrText } from '@/utils/tools';
|
||||
import { feConfigs } from '@/store/static';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
@@ -19,12 +19,11 @@ import { useConfirm } from '@/hooks/useConfirm';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import PageContainer from '@/components/PageContainer';
|
||||
import Avatar from '@/components/Avatar';
|
||||
import MyTooltip from '@/components/MyTooltip';
|
||||
const CreateModal = dynamic(() => import('./component/CreateModal'));
|
||||
import CreateModal from './component/CreateModal';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
@@ -79,7 +79,7 @@ const ChatHistorySlider = ({
|
||||
const concatHistory = useMemo<HistoryItemType[]>(
|
||||
() =>
|
||||
!activeChatId ? [{ id: activeChatId, title: t('chat.New Chat') }].concat(history) : history,
|
||||
[activeChatId, history]
|
||||
[activeChatId, history, t]
|
||||
);
|
||||
|
||||
const isShare = useMemo(() => !appId || !userInfo, [appId, userInfo]);
|
||||
|
@@ -16,7 +16,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
|
||||
icon: 'chat',
|
||||
label: '新对话',
|
||||
onClick: () => {
|
||||
router.push({
|
||||
router.replace({
|
||||
query: {
|
||||
appId
|
||||
}
|
||||
|
Reference in New Issue
Block a user