From 755ab8cd35175bf5abf40bde36f9971360ce7e49 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Sun, 30 Jul 2023 12:41:28 +0100 Subject: [PATCH] Show all course units by default --- uni/lib/view/course_units/course_units.dart | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/uni/lib/view/course_units/course_units.dart b/uni/lib/view/course_units/course_units.dart index 105933545..e59b22150 100644 --- a/uni/lib/view/course_units/course_units.dart +++ b/uni/lib/view/course_units/course_units.dart @@ -43,22 +43,11 @@ class CourseUnitsPageViewState element.compareTo(value) > 0 ? element : value, ); } + availableSemesters = _getAvailableSemesters(courseUnits); - final currentYear = int.tryParse( - selectedSchoolYear?.substring( - 0, - selectedSchoolYear?.indexOf('/'), - ) ?? - '', - ); - if (selectedSemester == null && - currentYear != null && - availableSemesters.length == 3) { - final currentDate = DateTime.now(); - selectedSemester = - currentDate.year <= currentYear || currentDate.month == 1 - ? availableSemesters[0] - : availableSemesters[1]; + + if (availableSemesters.length == 3 && selectedSemester == null) { + selectedSemester = availableSemesters[2]; } }