Skip to content

TCA-355 Fixes Issue w/FCC external URLs -> dev #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/src/components/layouts/tc-integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ class TcIntegrationLayout extends Component<TcIntegrationLayoutProps> {

// 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
Expand Down