6
6
SetStateAction ,
7
7
useCallback ,
8
8
useContext ,
9
- useEffect ,
10
9
useLayoutEffect ,
11
10
useRef ,
12
11
useState ,
@@ -21,13 +20,10 @@ import {
21
20
} from '../../../../lib'
22
21
import {
23
22
enrollTCACertificationAsync ,
24
- TCACertificationCheckCompleted ,
25
- TCACertificationProgress ,
26
23
TCACertificationProgressProviderData ,
27
24
TCACertificationProviderData ,
28
25
useGetTCACertification ,
29
26
useGetTCACertificationProgress ,
30
- useTCACertificationCheckCompleted ,
31
27
} from '../../learn-lib'
32
28
import { perks } from '../certification-details-modal/certif-details-content/data'
33
29
import { PerksSection } from '../perks-section'
@@ -60,7 +56,6 @@ const EnrollmentPage: FC<{}> = () => {
60
56
const {
61
57
progress,
62
58
ready : progressReady ,
63
- refetch : refetchProgress ,
64
59
setCertificateProgress,
65
60
} : TCACertificationProgressProviderData = useGetTCACertificationProgress (
66
61
profile ?. userId as unknown as string ,
@@ -70,17 +65,6 @@ const EnrollmentPage: FC<{}> = () => {
70
65
71
66
const ready : boolean = profileReady && certificationReady && progressReady && ! ! profile
72
67
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
-
84
68
if ( ready && profile && ! userInfo . current ) {
85
69
userInfo . current = { ...profile }
86
70
}
@@ -117,17 +101,8 @@ const EnrollmentPage: FC<{}> = () => {
117
101
118
102
function closeEnrolledModal ( ) : void {
119
103
setIsEnrolledModalOpen ( false )
120
- }
121
-
122
- useEffect ( ( ) => {
123
- if ( ! certCheckReady || isEnrolledModalOpen ) {
124
- return
125
- }
126
-
127
- refetchProgress ( )
128
104
navToCertificationDetails ( )
129
- // eslint-disable-next-line react-hooks/exhaustive-deps
130
- } , [ certCheckReady , isEnrolledModalOpen ] )
105
+ }
131
106
132
107
function renderMainContent ( ) : ReactNode {
133
108
return ready ? (
0 commit comments