fix: do nothing if switch to current app (#4249)

Co-authored-by: langyong <langyong@lixiang.com>
This commit is contained in:
Louie Long 2024-05-11 08:50:46 +08:00 committed by GitHub
parent 00ce372b71
commit 749b236d3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,6 +73,8 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }:
navs.map(nav => ( navs.map(nav => (
<Menu.Item key={nav.id}> <Menu.Item key={nav.id}>
<div className='flex items-center w-full px-3 py-[6px] text-gray-700 text-[14px] rounded-lg font-normal hover:bg-gray-100 cursor-pointer truncate' onClick={() => { <div className='flex items-center w-full px-3 py-[6px] text-gray-700 text-[14px] rounded-lg font-normal hover:bg-gray-100 cursor-pointer truncate' onClick={() => {
if (curNav?.id === nav.id)
return
setAppDetail() setAppDetail()
router.push(nav.link) router.push(nav.link)
}} title={nav.name}> }} title={nav.name}>