From 2108763b6d0572790beaece30482bec5585fd35c Mon Sep 17 00:00:00 2001 From: swve Date: Fri, 22 Dec 2023 16:36:18 +0100 Subject: [PATCH] fix: course start button bug --- .../[orgslug]/(withmenu)/course/[courseuuid]/course.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx b/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx index f23c9404..365404da 100644 --- a/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx +++ b/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/course.tsx @@ -43,8 +43,7 @@ const CourseClient = (props: any) => { function isCourseStarted() { const runs = course.trail.runs; - // checks if one of the obejcts in the array has the property "STATUS_IN_PROGRESS" - return runs.some((run: any) => run.status === "STATUS_IN_PROGRESS"); + return runs.some((run: any) => run.status === "STATUS_IN_PROGRESS" && run.course_id === course.id); } async function quitCourse() { @@ -193,11 +192,10 @@ const CourseClient = (props: any) => {
Author
-
{course.authors[0].first_name} {course.authors[0].last_name} { (course.authors[0].first_name && course.authors[0].last_name) ? course.authors[0].first_name + ' ' + course.authors[0].last_name : course.authors[0].username }
+
{course.authors[0].first_name} {course.authors[0].last_name} {(course.authors[0].first_name && course.authors[0].last_name) ? course.authors[0].first_name + ' ' + course.authors[0].last_name : course.authors[0].username}
} - {console.log(course)} {isCourseStarted() ? (