From c871ab34dcb42fc2b108a639a36fee2d775d0e88 Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 24 Aug 2022 09:18:14 -0700 Subject: [PATCH] TCA-355 #comment This commit fixes an issue w/FCC internal URLS #time 5m --- client/src/components/layouts/tc-integration.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/layouts/tc-integration.tsx b/client/src/components/layouts/tc-integration.tsx index 9d9a39c48cf3e0..69515d7a512859 100755 --- a/client/src/components/layouts/tc-integration.tsx +++ b/client/src/components/layouts/tc-integration.tsx @@ -135,13 +135,13 @@ class TcIntegrationLayout extends Component { // if this is a freecodecamp lesson, change its domain and path if (url.host === 'learn.freecodecamp.org') { - url.host = window.location.host; + url.host = new URL(document.referrer).host; // TODO: it would be nice to not require that the FCC // app knows about the paths in the platform UI, but // creating a way to share this info would be complex and // time consuming, so we can handle it when we get another // provider. - url.pathname = `learn/freecodecamp/${url.pathname}`; + url.pathname = `learn/freecodecamp${url.pathname}`; } // now open the url in a new tab