From 1e154e107273f20990821ec01111dacb0ec060ea Mon Sep 17 00:00:00 2001 From: Marc Itzenthaler Date: Tue, 16 Jan 2024 10:33:39 +0100 Subject: [PATCH] fix: fix urls without domain --- src/globalState/provider/LegalLinksProvider.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/globalState/provider/LegalLinksProvider.tsx b/src/globalState/provider/LegalLinksProvider.tsx index 2352891cc..c6f53b067 100644 --- a/src/globalState/provider/LegalLinksProvider.tsx +++ b/src/globalState/provider/LegalLinksProvider.tsx @@ -49,7 +49,13 @@ export function LegalLinksProvider({ ...legalLink, getUrl: (params: { [key: string]: string | number | null | undefined; - }) => getUrl(url, params) + }) => + getUrl( + url.match(/http(s)?:\/\//) + ? url + : `${window.location.origin}${url}`, + params + ) }) ), [externalLegalLinks, settings.legalLinks, getUrl]