File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src-ts/tools/learn/free-code-camp Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -273,15 +273,19 @@ const FreeCodeCamp: FC<{}> = () => {
273273
274274 // This is the last lesson to be completed in the first module completed,
275275 // so it's time to trigger the survey
276+ const surveyTrigger : string = 'TCA First Module Completed'
276277
277278 // If there is only one assessment in a cert (e.g. Data Analysis w/Python),
278279 // the cert is also completed, which redirects the user to the cert page.
279280 // So the survey needs to be delayed so that it appears on the completed
280281 // 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 )
282+ if ( progress . certificationProgressPercentage === 100 ) {
283+ setTimeout ( async ( ) => {
284+ surveyTriggerForUser ( surveyTrigger , profile ?. userId )
285+ } , 1000 )
286+ } else {
287+ surveyTriggerForUser ( surveyTrigger , profile ?. userId )
288+ }
285289 }
286290
287291 /**
You can’t perform that action at this time.
0 commit comments