66 SetStateAction ,
77 useCallback ,
88 useContext ,
9- useEffect ,
109 useLayoutEffect ,
1110 useRef ,
1211 useState ,
@@ -21,13 +20,10 @@ import {
2120} from '../../../../lib'
2221import {
2322 enrollTCACertificationAsync ,
24- TCACertificationCheckCompleted ,
25- TCACertificationProgress ,
2623 TCACertificationProgressProviderData ,
2724 TCACertificationProviderData ,
2825 useGetTCACertification ,
2926 useGetTCACertificationProgress ,
30- useTCACertificationCheckCompleted ,
3127} from '../../learn-lib'
3228import { perks } from '../certification-details-modal/certif-details-content/data'
3329import { PerksSection } from '../perks-section'
@@ -60,7 +56,6 @@ const EnrollmentPage: FC<{}> = () => {
6056 const {
6157 progress,
6258 ready : progressReady ,
63- refetch : refetchProgress ,
6459 setCertificateProgress,
6560 } : TCACertificationProgressProviderData = useGetTCACertificationProgress (
6661 profile ?. userId as unknown as string ,
@@ -70,17 +65,6 @@ const EnrollmentPage: FC<{}> = () => {
7065
7166 const ready : boolean = profileReady && certificationReady && progressReady && ! ! profile
7267
73- const firstResourceProgress : TCACertificationProgress [ 'resourceProgresses' ] [ 0 ] | undefined
74- = progress ?. resourceProgresses ?. [ 0 ]
75-
76- const {
77- ready : certCheckReady ,
78- } : TCACertificationCheckCompleted = useTCACertificationCheckCompleted (
79- firstResourceProgress ?. resourceProgressType ?? '' ,
80- firstResourceProgress ?. resourceProgressId ?? '' ,
81- { enabled : ! ! firstResourceProgress ?. resourceProgressType } ,
82- )
83-
8468 if ( ready && profile && ! userInfo . current ) {
8569 userInfo . current = { ...profile }
8670 }
@@ -117,17 +101,8 @@ const EnrollmentPage: FC<{}> = () => {
117101
118102 function closeEnrolledModal ( ) : void {
119103 setIsEnrolledModalOpen ( false )
120- }
121-
122- useEffect ( ( ) => {
123- if ( ! certCheckReady || isEnrolledModalOpen ) {
124- return
125- }
126-
127- refetchProgress ( )
128104 navToCertificationDetails ( )
129- // eslint-disable-next-line react-hooks/exhaustive-deps
130- } , [ certCheckReady , isEnrolledModalOpen ] )
105+ }
131106
132107 function renderMainContent ( ) : ReactNode {
133108 return ready ? (
0 commit comments