File tree Expand file tree Collapse file tree 5 files changed +25
-9
lines changed Expand file tree Collapse file tree 5 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,23 @@ const CourseCompletedPage: FC<{}> = () => {
7676 { enabled : ! ! tcaCertificationName } ,
7777 )
7878
79- const isLoggedIn : boolean = profileReady && ! ! profile
80- const certificatesDataReady : boolean = progressReady && certifReady
81- const tcaCertReady : boolean = progressReady && ( ! progress ?. id || ! ! tcaCertifCompletedCheckReady )
82- const ready : boolean = profileReady && courseDataReady && (
83- ! isLoggedIn || ( certificatesDataReady && tcaCertReady )
84- )
79+ const ready : boolean = useMemo ( ( ) => {
80+ const isLoggedIn : boolean = profileReady && ! ! profile
81+ const certificatesDataReady : boolean = progressReady && certifReady
82+ const tcaCertReady : boolean = progressReady && ( ! progress ?. id || ! ! tcaCertifCompletedCheckReady )
83+
84+ return profileReady && courseDataReady && (
85+ ! isLoggedIn || ( certificatesDataReady && tcaCertReady )
86+ )
87+ } , [
88+ certifReady ,
89+ courseDataReady ,
90+ profile ,
91+ profileReady ,
92+ progress ?. id ,
93+ progressReady ,
94+ tcaCertifCompletedCheckReady ,
95+ ] )
8596
8697 const location : any = useLocation ( )
8798
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import styles from '../CourseCompletedPage.module.scss'
1010interface TCACertificationViewProps {
1111 courseData : LearnCourse
1212 certification ?: TCACertification
13+ // eslint-disable-next-line react/no-unused-prop-types
1314 certificationParam : string
15+ // eslint-disable-next-line react/no-unused-prop-types
1416 userHandle ?: string
1517}
1618
Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ const CourseTitle: FC<CourseTitleProps> = (props: CourseTitleProps) => {
3939 < div className = { classNames ( styles . wrap , props . size ) } >
4040 < div className = { classNames ( 'badge-icon' , props . size ) } >
4141 { props . badgeType === TitleBadgeType . tcaCertification ? (
42- < CertificateBadgeIcon type = { props . trackType ?? 'DEV' } level = { props . learnLevel ! } />
42+ < CertificateBadgeIcon
43+ type = { props . trackType ?? 'DEV' }
44+ level = { props . learnLevel as TCACertificationLearnLevel }
45+ />
4346 ) : (
4447 < CourseBadge type = { props . trackType ?? 'DEV' } />
4548 ) }
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ const CertificateView: FC<{}> = () => {
2828 const userHandle : string = `${ routeParams . memberHandle } `
2929 const certificationParam : string = routeParams . certification ?? ''
3030
31-
3231 const tcaCertificationPath : string = getTCACertificationPath ( certificationParam )
3332
3433 const {
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ const placeholderUserProfile: UserProfile = {
1717} as UserProfile
1818
1919const placeholderEnrollment : TCACertificationEnrollmentBase = {
20- completedAt : new Date ( ) . toISOString ( ) ,
20+ completedAt : new Date ( )
21+ . toISOString ( ) ,
2122 completionUuid : 'test-uuid' ,
2223 userHandle : 'your_handle' ,
2324 userName : 'Your Name' ,
You can’t perform that action at this time.
0 commit comments