Skip to content

Commit 4e6e633

Browse files
authored
Merge pull request #4057 from kovsu/fix/#4019
feat(desktop): enhance link handling
1 parent 8bcc6fa commit 4e6e633

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

apps/desktop/layer/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ export const EntryItemWrapper: FC<
8989
e.preventDefault()
9090
e.stopPropagation()
9191

92+
const target = e.target as HTMLElement
93+
const linkElement = target.closest("a")
94+
95+
if (linkElement) {
96+
const href = linkElement.getAttribute("href")
97+
if (!href) return
98+
99+
if (entry?.id && href.endsWith(entry.id)) return
100+
window.open(href, "_blank")
101+
return
102+
}
103+
92104
const shouldNavigate = getRouteParams().entryId !== entry?.id
93105

94106
if (!shouldNavigate) return

0 commit comments

Comments
 (0)