File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src-ts/tools/learn/free-code-camp Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -265,10 +265,24 @@ const FreeCodeCamp: FC<{}> = () => {
265265
266266 // eslint-disable-next-line react-hooks/exhaustive-deps
267267 const handleFccLessonComplete : ( challengeUuid : string ) => void = useCallback ( debounce ( ( challengeUuid : string ) => {
268+ let lessonName : string = ''
269+ let moduleName : string = ''
270+
271+ // Search in course's meta data, to determine the correct lesson name and module name based on the challengeUuid
272+ courseData ! . modules . forEach ( m => {
273+ const lessonData : LearnLesson | undefined = m . lessons . find ( l => l . id === challengeUuid )
274+
275+ if ( ! lessonData ) {
276+ return
277+ }
278+
279+ lessonName = lessonData . dashedName
280+ moduleName = m . dashedName
281+ } )
268282
269283 const currentLesson : { [ key : string ] : string } = {
270- lesson : lessonParam ,
271- module : moduleParam ,
284+ lesson : lessonName ,
285+ module : moduleName ,
272286 uuid : challengeUuid ,
273287 }
274288
You can’t perform that action at this time.
0 commit comments