Skip to content

Commit 0adf4fb

Browse files
making absolutely sure that challenge courses are at the bottom of the list
1 parent 507bad7 commit 0adf4fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server/util/pointRecommendCourses.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,11 @@ function pointRecommendedCourses(courses: CourseRecommendation[], userCoordinate
185185
if(isGenericCourse && mandatory && !isChallengeCourseOrEri){
186186
bonusPoints += bonusPoint * 2
187187
}
188-
189188

189+
const pickedChallenge = userCoordinates?.challenge === undefined | null
190+
if(!pickedChallenge && isChallengeCourseOrEri){
191+
bonusPoints = 0
192+
}
190193

191194
return points >= 0 ? {...c, points: points + bonusPoints} : {...c, points}
192195
})

0 commit comments

Comments
 (0)