Merge pull request #4057 from kovsu/fix/#4019

feat(desktop): enhance link handling
This commit is contained in:
Konv Suu 2025-07-02 15:18:11 +08:00 committed by GitHub
parent 8bcc6faada
commit 4e6e63329e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -89,6 +89,18 @@ export const EntryItemWrapper: FC<
e.preventDefault()
e.stopPropagation()
const target = e.target as HTMLElement
const linkElement = target.closest("a")
if (linkElement) {
const href = linkElement.getAttribute("href")
if (!href) return
if (entry?.id && href.endsWith(entry.id)) return
window.open(href, "_blank")
return
}
const shouldNavigate = getRouteParams().entryId !== entry?.id
if (!shouldNavigate) return