|
| 1 | +import { debounce } from 'lodash' |
1 | 2 | import { |
2 | 3 | Dispatch, |
3 | 4 | FC, |
@@ -45,7 +46,6 @@ import { FccFrame } from './fcc-frame' |
45 | 46 | import { FccSidebar } from './fcc-sidebar' |
46 | 47 | import { TitleNav } from './title-nav' |
47 | 48 | import styles from './FreeCodeCamp.module.scss' |
48 | | -import { debounce } from 'lodash' |
49 | 49 |
|
50 | 50 | const FreeCodeCamp: FC<{}> = () => { |
51 | 51 |
|
@@ -274,24 +274,11 @@ const FreeCodeCamp: FC<{}> = () => { |
274 | 274 |
|
275 | 275 | // This is the last lesson to be completed in the first module completed, |
276 | 276 | // so it's time to trigger the survey |
277 | | - const surveyTrigger: string = 'TCA First Module Completed' |
278 | | - |
279 | | - // If there is only one assessment in a cert (e.g. Data Analysis w/Python), |
280 | | - // the cert is also completed, which redirects the user to the cert page. |
281 | | - // So the survey needs to be delayed so that it appears on the completed |
282 | | - // cert page instead of the current lesson. |
283 | | - |
284 | | - // NOTE: we can't use the cert's status here bc it doesn't get set to |
285 | | - // completed until the UI notices the cert is complete and initiates |
286 | | - // the completion. And we have to use >= instead of === because it's |
287 | | - // possible TCA data isn't in sync w/the latest FCC curriculum. |
288 | | - if (progress.certificationProgressPercentage >= 100) { |
289 | | - setTimeout(async () => { |
290 | | - surveyTriggerForUser(surveyTrigger, profile?.userId) |
291 | | - }, 1000) |
292 | | - } else { |
293 | | - surveyTriggerForUser(surveyTrigger, profile?.userId) |
294 | | - } |
| 277 | + |
| 278 | + // NOTE: We have to add a delay, otherwise the survey closes when the user |
| 279 | + // is automatically redirected to the next lesson. |
| 280 | + surveyTriggerForUser('TCA First Module Completed', profile?.userId) |
| 281 | + |
295 | 282 | } |
296 | 283 |
|
297 | 284 | /** |
|
0 commit comments