File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
client/src/components/layouts Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,10 @@ class TcIntegrationLayout extends Component<TcIntegrationLayoutProps> {
146
146
// set the pathname for the 2 flavors of lesson URL
147
147
const platformPathPrefix = 'learn/freecodecamp' ;
148
148
const learnPrefix = '/learn/' ;
149
+ let updateHost = false ;
149
150
if ( url . host === `learn.${ fccHost } ` ) {
150
151
url . pathname = `${ platformPathPrefix } ${ url . pathname } ` ;
152
+ updateHost = true ;
151
153
} else if (
152
154
url . host === `www.${ fccHost } ` &&
153
155
url . pathname . startsWith ( learnPrefix )
@@ -156,10 +158,13 @@ class TcIntegrationLayout extends Component<TcIntegrationLayoutProps> {
156
158
learnPrefix ,
157
159
`/${ platformPathPrefix } /`
158
160
) ;
161
+ updateHost = true ;
159
162
}
160
163
161
164
// set the host to the iframe's parent domain
162
- url . host = new URL ( document . referrer ) . host ;
165
+ if ( updateHost ) {
166
+ url . host = new URL ( document . referrer ) . host ;
167
+ }
163
168
}
164
169
165
170
// now open the url in a new tab
You can’t perform that action at this time.
0 commit comments