diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index f3d2bd193..d6e33a087 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -35,7 +35,7 @@ const Layout = ({ children, isPcDevice }: { children: JSX.Element; isPcDevice: b return ( <> - + {isPc ? ( pcUnShowLayoutRoute[router.pathname] ? ( {children} diff --git a/src/pages/chat/index.tsx b/src/pages/chat/index.tsx index ff4af3563..d981ddbec 100644 --- a/src/pages/chat/index.tsx +++ b/src/pages/chat/index.tsx @@ -198,7 +198,6 @@ const Chat = ({ if (newChatId) { setForbidLoadChatData(true); router.replace(`/chat?modelId=${modelId}&chatId=${newChatId}`); - loadHistory({ pageNum: 1, init: true }); } } catch (err) { toast({ @@ -222,6 +221,9 @@ const Chat = ({ }; }) })); + + // refresh history + loadHistory({ pageNum: 1, init: true }); }, [ chatId, @@ -488,10 +490,6 @@ const Chat = ({ modelId && setLastChatModelId(modelId); setLastChatId(chatId); - /* get mode and chat into ↓ */ - - // phone: history page - if (!isPc && Object.keys(router.query).length === 0) return null; if (forbidLoadChatData) { setForbidLoadChatData(false); return null; @@ -566,7 +564,7 @@ const Chat = ({ try { setIsLoading(true); await onclickDelHistory(chatData.chatId); - router.replace(`/chat`); + router.replace(`/chat?modelId=${modelId}`); } catch (err) { console.log(err); }