bug: add locale to webview links

This commit is contained in:
Christel Westerberg
2024-07-08 16:09:52 +02:00
parent cccfbfe29a
commit 012d9ae798

View File

@@ -1,6 +1,7 @@
import JsonToHtml from "@/components/JsonToHtml" import JsonToHtml from "@/components/JsonToHtml"
import Overview from "@/components/MyPages/Blocks/Overview" import Overview from "@/components/MyPages/Blocks/Overview"
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts" import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
import { removeMultipleSlashes } from "@/utils/url"
import { modWebviewLink } from "@/utils/webviews" import { modWebviewLink } from "@/utils/webviews"
import CurrentBenefitsBlock from "../../Blocks/Benefits/CurrentLevel" import CurrentBenefitsBlock from "../../Blocks/Benefits/CurrentLevel"
@@ -57,9 +58,11 @@ export default function Content({ lang, content }: ContentProps) {
item.dynamic_content.link.linkConnection.edges[0].node item.dynamic_content.link.linkConnection.edges[0].node
.original_url || .original_url ||
modWebviewLink( modWebviewLink(
removeMultipleSlashes(
`/${item.dynamic_content.link.linkConnection.edges[0].node.system.locale}/${item.dynamic_content.link.linkConnection.edges[0].node.url}`
),
item.dynamic_content.link.linkConnection.edges[0].node item.dynamic_content.link.linkConnection.edges[0].node
.url, .system.locale
lang
), ),
text: item.dynamic_content.link.link_text, text: item.dynamic_content.link.link_text,
} }