We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6a588cd + 3f1525e commit 8764160Copy full SHA for 8764160
src/hooks/useSurvey.ts
@@ -1,11 +1,15 @@
1
+import path from "path"
2
+
3
import { useMemo } from "react"
4
import { useRouter } from "next/router"
5
6
+import type { Lang } from "@/lib/types"
7
8
import { SITE_URL } from "@/lib/constants"
9
10
export const useSurvey = (feedbackSubmitted: boolean) => {
- const { asPath } = useRouter()
- 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)
13
return useMemo((): string | null => {
14
if (!feedbackSubmitted) return null
15
return `https://iwokuhuz.paperform.co//?url=${url}`
0 commit comments