Skip to content

Commit ff52287

Browse files
actually link to the correct url (#14105)
1 parent 737d8e2 commit ff52287

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/SearchUI/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const Search = ({
7373

7474
const handleChange = (hit: Hit) => {
7575
if (!hit) return
76-
navigate(`/${hit.slug}`, { state: { newWindow: true } })
76+
navigate(`${hit.fields?.slug || `/${hit.slug}`}`, { state: { newWindow: true } })
7777
onChange?.()
7878
}
7979

@@ -160,7 +160,7 @@ const Search = ({
160160
>
161161
<div className="py-2 px-4 block">
162162
<p className="text-[13px] text-red dark:text-yellow font-medium m-0">
163-
/{hit.fields?.slug || hit.slug}
163+
{hit.fields?.slug || `/${hit.slug}`}
164164
</p>
165165
<h5 className="text-[15px] m-0 font-bold line-clamp-1">
166166
{hit.title}

0 commit comments

Comments
 (0)