Skip to content

Commit 8764160

Browse files
authored
Merge pull request #12931 from ethereum/usesurvey-patch
fix: add locale to useSurvey URL being logged
2 parents 6a588cd + 3f1525e commit 8764160

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/hooks/useSurvey.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
import path from "path"
2+
13
import { useMemo } from "react"
24
import { useRouter } from "next/router"
35

6+
import type { Lang } from "@/lib/types"
7+
48
import { SITE_URL } from "@/lib/constants"
59

610
export const useSurvey = (feedbackSubmitted: boolean) => {
7-
const { asPath } = useRouter()
8-
const { href: url } = new URL(asPath, SITE_URL)
11+
const { asPath, locale } = useRouter()
12+
const { href: url } = new URL(path.join(locale! as Lang, asPath), SITE_URL)
913
return useMemo((): string | null => {
1014
if (!feedbackSubmitted) return null
1115
return `https://iwokuhuz.paperform.co//?url=${url}`

0 commit comments

Comments
 (0)