Skip to content

Commit

Permalink
Show all course units by default
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes committed Jul 30, 2023
1 parent 3b9eef7 commit 755ab8c
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions uni/lib/view/course_units/course_units.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down

0 comments on commit 755ab8c

Please sign in to comment.