File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src-ts/tools/learn/free-code-camp Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import { FccFrame } from './fcc-frame'
45
45
import { FccSidebar } from './fcc-sidebar'
46
46
import { TitleNav } from './title-nav'
47
47
import styles from './FreeCodeCamp.module.scss'
48
+ import { debounce } from 'lodash'
48
49
49
50
const FreeCodeCamp : FC < { } > = ( ) => {
50
51
@@ -211,7 +212,7 @@ const FreeCodeCamp: FC<{}> = () => {
211
212
profile ?. userId ,
212
213
] )
213
214
214
- const handleFccLessonComplete : ( challengeUuid : string ) => void = useCallback ( ( challengeUuid : string ) => {
215
+ const handleFccLessonComplete : ( challengeUuid : string ) => void = useCallback ( debounce ( ( challengeUuid : string ) => {
215
216
216
217
const currentLesson : { [ key : string ] : string } = {
217
218
lesson : lessonParam ,
@@ -239,7 +240,7 @@ const FreeCodeCamp: FC<{}> = () => {
239
240
240
241
} )
241
242
// eslint-disable-next-line react-hooks/exhaustive-deps
242
- } , [
243
+ } , 30 ) , [
243
244
certificateProgress ,
244
245
lessonParam ,
245
246
moduleParam ,
@@ -280,7 +281,7 @@ const FreeCodeCamp: FC<{}> = () => {
280
281
* Handle the navigation away from the last step of the course in the FCC frame
281
282
* @returns
282
283
*/
283
- const handleFccLastLessonNavigation : ( ) => void = useCallback ( ( ) => {
284
+ const handleFccLastLessonNavigation : ( ) => void = useCallback ( debounce ( ( ) => {
284
285
285
286
if ( ! certificateProgress ) {
286
287
return
@@ -326,7 +327,7 @@ const FreeCodeCamp: FC<{}> = () => {
326
327
327
328
navigate ( nextLessonPath )
328
329
// eslint-disable-next-line react-hooks/exhaustive-deps
329
- } , [
330
+ } , 30 ) , [
330
331
certificateProgress ,
331
332
certificationParam ,
332
333
courseData ?. modules ,
You can’t perform that action at this time.
0 commit comments