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

View File

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