perf: dynamic

This commit is contained in:
archer
2023-07-28 16:09:10 +08:00
parent 0a689b0ab8
commit 5d0c8fa462
5 changed files with 5 additions and 8 deletions

View File

@@ -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';

View File

@@ -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';

View File

@@ -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]);

View File

@@ -16,7 +16,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
icon: 'chat',
label: '新对话',
onClick: () => {
router.push({
router.replace({
query: {
appId
}