1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-11-23 09:16:48 -06:00

Fix showing summary summary for subjects without partial grades (#877)

This commit is contained in:
Mikołaj Pich 2020-06-11 14:38:04 +02:00 committed by GitHub
parent eedaa63771
commit 30af77614e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -77,8 +77,8 @@ android {
}
}
viewBinding {
enabled = true
buildFeatures {
viewBinding = true
}
lintOptions {
@ -124,7 +124,7 @@ configurations.all {
}
dependencies {
implementation "io.github.wulkanowy:sdk:0.18.3"
implementation "io.github.wulkanowy:sdk:7dc0761"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "androidx.core:core-ktx:1.2.0"

View File

@ -98,7 +98,7 @@ class GradeAverageProvider @Inject constructor(
}
private fun List<GradeSummary>.emulateEmptySummaries(student: Student, semester: Semester, grades: List<Pair<String, List<Grade>>>, calcAverage: Boolean): List<GradeSummary> {
if (isNotEmpty() && size == grades.size) return this
if (isNotEmpty() && size > grades.size) return this
return grades.mapIndexed { i, (subject, details) ->
singleOrNull { it.subject == subject }?.let { return@mapIndexed it }

View File

@ -23,6 +23,8 @@ fun Sdk.init(student: Student): Sdk {
certKey = student.certificateKey
privateKey = student.privateKey
emptyCookieJarInterceptor = true
Timber.d("Sdk in ${student.loginMode} mode reinitialized")
return this