Skip to content

Commit cbbe787

Browse files
committed
fix: avoid next.js from prefetching short links
1 parent 6a07487 commit cbbe787

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/components/links/link-card.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ export function LinkCard({ createdAt, description, destination, shortLink, ...pr
4040
</div>
4141
<div className='flex w-full min-w-0 flex-col'>
4242
<div className='flex items-center gap-2'>
43-
<Link href={data.link} target='_blank' className='truncate font-medium hover:underline' rel='noreferrer'>
43+
<Link
44+
target='_blank'
45+
rel='noreferrer'
46+
href={data.link}
47+
prefetch={false}
48+
className='truncate font-medium hover:underline'
49+
>
4450
{shortLink}
4551
</Link>
4652
</div>

src/components/links/public-link-card.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export function PublicLinkCard({ description, destination, shortLink, ...props }
3535
/>
3636
<div className='flex w-full min-w-0 flex-col'>
3737
<div className='flex items-center gap-2'>
38-
<Link href={data.link} target='_blank' className='truncate font-medium hover:underline' rel='noreferrer'>
38+
<Link
39+
target='_blank'
40+
rel='noreferrer'
41+
href={data.link}
42+
prefetch={false}
43+
className='truncate font-medium hover:underline'
44+
>
3945
{shortLink}
4046
</Link>
4147
</div>

0 commit comments

Comments
 (0)