fix(web): prevent navbar clearing app state on cmd+click (#28935)

This commit is contained in:
Lê Quốc Bình 2025-11-30 11:43:47 +07:00 committed by GitHub
parent 02adf4ff06
commit a37497ffb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -52,7 +52,12 @@ const Nav = ({
`}>
<Link href={link + (linkLastSearchParams && `?${linkLastSearchParams}`)}>
<div
onClick={() => setAppDetail()}
onClick={(e) => {
// Don't clear state if opening in new tab/window
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0)
return
setAppDetail()
}}
className={classNames(
'flex h-7 cursor-pointer items-center rounded-[10px] px-2.5',
isActivated ? 'text-components-main-nav-nav-button-text-active' : 'text-components-main-nav-nav-button-text',