From c77ce50f9ba29a28e9521daf3409083da49a702e Mon Sep 17 00:00:00 2001 From: ProgramistaZpolski Date: Mon, 12 Aug 2024 17:05:37 +0200 Subject: [PATCH] Fix not being able to change from 1st to 3rd semester --- .../github/wulkanowy/ui/modules/grade/GradePresenter.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradePresenter.kt index 75fe840c..a7749a72 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradePresenter.kt @@ -59,13 +59,17 @@ class GradePresenter @Inject constructor( } fun onSemesterSelected(index: Int) { - if (selectedIndex != index - 1) { + if (selectedIndex != index + 1) { Timber.i("Change semester in grade view to ${index + 1}") selectedIndex = index + 1 selectedSemesterId = availableSemesters[index].semesterId loadedSemesterId.clear() view?.let { - it.setCurrentSemesterName(availableSemesters[index].semesterName, availableSemesters[index].start.year, availableSemesters[index].end.year) + it.setCurrentSemesterName( + availableSemesters[index].semesterName, + availableSemesters[index].start.year, + availableSemesters[index].end.year + ) notifyChildrenSemesterChange() loadChild(it.currentPageIndex) }