mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 20:02:45 +01:00
Fix grade sorting by date (#1717)
This commit is contained in:
parent
1bcc4d199e
commit
d89e4ccfdf
@ -230,10 +230,14 @@ class GradeDetailsPresenter @Inject constructor(
|
|||||||
gradesWithAverages.filter { it.grades.isNotEmpty() }
|
gradesWithAverages.filter { it.grades.isNotEmpty() }
|
||||||
} else gradesWithAverages
|
} else gradesWithAverages
|
||||||
}
|
}
|
||||||
.let {
|
.let { gradeSubjects ->
|
||||||
when (preferencesRepository.gradeSortingMode) {
|
when (preferencesRepository.gradeSortingMode) {
|
||||||
DATE -> it.sortedByDescending { gradeDetailsWithAverage -> gradeDetailsWithAverage.grades.firstOrNull()?.date }
|
DATE -> gradeSubjects.sortedByDescending { gradeDetailsWithAverage ->
|
||||||
ALPHABETIC -> it.sortedBy { gradeDetailsWithAverage -> gradeDetailsWithAverage.subject.lowercase() }
|
gradeDetailsWithAverage.grades.maxByOrNull { it.date }?.date
|
||||||
|
}
|
||||||
|
ALPHABETIC -> gradeSubjects.sortedBy { gradeDetailsWithAverage ->
|
||||||
|
gradeDetailsWithAverage.subject.lowercase()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.map { (subject, average, points, _, grades) ->
|
.map { (subject, average, points, _, grades) ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user