From e2dd79a2f00502f1ef59d7f203938cab2a02406d Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Mon, 10 Oct 2022 17:08:31 +0300 Subject: [PATCH 1/2] TCA-513 - wait for course data to load before fetching ceritificate data --- src-ts/tools/learn/course-details/CourseDetailsPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx index 968f38f58..8f16c8b20 100644 --- a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx +++ b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx @@ -55,7 +55,9 @@ const CourseDetailsPage: FC<{}> = () => { const { certification: certificate, ready: certificateReady, - }: AllCertificationsProviderData = useAllCertifications(routeParams.provider, course?.certificationId) + }: AllCertificationsProviderData = useAllCertifications(routeParams.provider, course?.certificationId, { + enabled: courseReady + }) // this looks better than finding workarounds for cyclomatic-complexity /* tslint:disable:cyclomatic-complexity */ From 323c51a77bbebed9b744811a3b7a888ab55d8f60 Mon Sep 17 00:00:00 2001 From: Vasilica Olariu Date: Mon, 10 Oct 2022 18:07:26 +0300 Subject: [PATCH 2/2] lint fix --- src-ts/tools/learn/course-details/CourseDetailsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx index 8f16c8b20..1795fecfd 100644 --- a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx +++ b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx @@ -56,7 +56,7 @@ const CourseDetailsPage: FC<{}> = () => { certification: certificate, ready: certificateReady, }: AllCertificationsProviderData = useAllCertifications(routeParams.provider, course?.certificationId, { - enabled: courseReady + enabled: courseReady, }) // this looks better than finding workarounds for cyclomatic-complexity