From e6c9ca540a489a6635f63d10b95a856755eb90ff Mon Sep 17 00:00:00 2001
From: Archer <545436317@qq.com>
Date: Fri, 17 Mar 2023 22:06:43 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E8=81=8A=E5=A4=A9=E4=BE=A7=E8=BE=B9?=
=?UTF-8?q?=E6=A0=8F=E6=9C=AA=E6=BB=9A=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Layout/navbar.tsx | 8 +-
src/components/Layout/navbarPhone.tsx | 1 +
src/pages/chat/components/SlideBar.tsx | 155 +++++++++++--------------
3 files changed, 76 insertions(+), 88 deletions(-)
diff --git a/src/components/Layout/navbar.tsx b/src/components/Layout/navbar.tsx
index dd9dc8517..9001c7174 100644
--- a/src/components/Layout/navbar.tsx
+++ b/src/components/Layout/navbar.tsx
@@ -45,12 +45,12 @@ const Navbar = ({
flexDirection={'column'}
alignItems={'center'}
justifyContent={'center'}
- onClick={() =>
- !item.activeLink.includes(router.pathname) &&
+ onClick={() => {
+ if (item.link === router.pathname) return;
router.push(item.link, undefined, {
shallow: true
- })
- }
+ });
+ }}
cursor={'pointer'}
fontSize={'sm'}
w={'60px'}
diff --git a/src/components/Layout/navbarPhone.tsx b/src/components/Layout/navbarPhone.tsx
index 251a0a791..4b22ce3be 100644
--- a/src/components/Layout/navbarPhone.tsx
+++ b/src/components/Layout/navbarPhone.tsx
@@ -57,6 +57,7 @@ const NavbarPhone = ({
alignItems={'center'}
justifyContent={'center'}
onClick={() => {
+ if (item.link === router.pathname) return;
router.push(item.link);
onClose();
}}
diff --git a/src/pages/chat/components/SlideBar.tsx b/src/pages/chat/components/SlideBar.tsx
index 776a0b129..c2c068a39 100644
--- a/src/pages/chat/components/SlideBar.tsx
+++ b/src/pages/chat/components/SlideBar.tsx
@@ -80,29 +80,7 @@ const SlideBar = ({
{item.title}
- {/* {
- updateChatHistory(item.windowId, e.target.value);
- }}
- /> */}
- {/* }
- variant={'unstyled'}
- aria-label={'edit'}
- size={'xs'}
- onClick={(e) => {
- console.log(e);
- setEditHistoryId(item.windowId);
- }}
- /> */}
}
variant={'unstyled'}
@@ -120,7 +98,14 @@ const SlideBar = ({
);
return (
-
+
{/* 新对话 */}
+
+ {isSuccess ? (
+
+
+
+
+ 历史记录
+
+
+
+
+ {hasReady && }
+
+
+
+
+
+ 其他模型
+
+
+
+
+ {myModels.map((item) => (
+ {
+ if (item.name === name) return;
+ router.push(
+ `/chat?chatId=${await generateChatWindow(item._id)}&timeStamp=${Date.now()}`
+ );
+ onClose();
+ }}
+ >
+
+
+ {item.name}
+
+
+ ))}
+
+
+
+ ) : (
+
+ )}
+
+
);
};