restore ctrl+click on item title clicking

This commit is contained in:
keyan 2023-10-26 12:30:13 -05:00
parent 02b98582b8
commit 4d98110282
1 changed files with 9 additions and 1 deletions

View File

@ -57,9 +57,17 @@ export default function Item ({ item, rank, belowTitle, right, full, children, s
const viewedAt = commentsViewedAt(item)
if (viewedAt) {
e.preventDefault()
router.push(
if (e.ctrlKey || e.metaKey) {
window.open(
`/items/${item.id}?commentsViewedAt=${viewedAt}`,
'_blank',
'noopener,noreferrer'
)
} else {
router.push(
`/items/${item.id}?commentsViewedAt=${viewedAt}`,
`/items/${item.id}`)
}
}
}} ref={titleRef} className={`${styles.title} text-reset me-2`}
>