File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src-ts/tools/learn/free-code-camp Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -271,9 +271,17 @@ const FreeCodeCamp: FC<{}> = () => {
271271 return
272272 }
273273
274- // this is the last lesson to be completed in the first module completed,
275- // so it's good to show the trigger
276- surveyTriggerForUser ( 'TCA First Module Completed' , profile ?. userId )
274+ // This is the last lesson to be completed in the first module completed,
275+ // so it's time to trigger the survey
276+
277+ // If there is only one assessment in a cert (e.g. Data Analysis w/Python),
278+ // the cert is also completed, which redirects the user to the cert page.
279+ // So the survey needs to be delayed so that it appears on the completed
280+ // cert page instead of the current lesson.
281+ const delay : number = progress . status === UserCertificationProgressStatus . completed ? 3000 : 0
282+ setTimeout ( async ( ) => {
283+ surveyTriggerForUser ( 'TCA First Module Completed' , profile ?. userId )
284+ } , delay )
277285 }
278286
279287 /**
You can’t perform that action at this time.
0 commit comments