Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,11 @@ const FreeCodeCamp: FC<{}> = () => {
if (lessonPath !== lessonParam) {
setLessonParam(lessonPath)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
certificationParam,
lessonParam,
moduleParam,
// DO NOT UPDATE THIS DEPS ARRAY!!
// we do not care about changes to the other deps
// !!only routeParams needs to trigger this effect!!
routeParams,
])

Expand Down
6 changes: 4 additions & 2 deletions src-ts/tools/learn/free-code-camp/fcc-frame/FccFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const FccFrame: FC<FccFrameProps> = (props: FccFrameProps) => {
const frameRef: MutableRefObject<HTMLElement | any> = useRef()
const frameIsReady: MutableRefObject<boolean> = useRef<boolean>(false)
const { onFccLastLessonNavigation, onFccLessonChange, onFccLessonComplete }: FccFrameProps = props
const lessonUrl: string | undefined = props.lesson?.lessonUrl

useEffect(() => {
if (!frameRef.current || !props.lesson) {
Expand All @@ -35,12 +36,13 @@ const FccFrame: FC<FccFrameProps> = (props: FccFrameProps) => {
Object.assign(frameRef.current, { src: `${EnvironmentConfig.LEARN_SRC}/${props.lesson.lessonUrl}` })
} else {
frameRef.current.contentWindow.postMessage(JSON.stringify({
data: { path: `/${props.lesson.lessonUrl}` },
data: { path: `/${lessonUrl}` },
event: 'fcc:url:update',
}), '*')
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
props.lesson,
lessonUrl,
])

useEffect(() => {
Expand Down