Skip to content

Commit 3e0ee99

Browse files
TCA-790 #comment This commit sets a timeout and uses the cert progress #time 1h
1 parent 8c10a2c commit 3e0ee99

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)