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 ( - + {/* 新对话 */}