Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/src/main/java/org/wikipedia/settings/RemoteConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object RemoteConfig {
RemoteConfigImpl()
}
}
return curConfig!!
return curConfig ?: RemoteConfigImpl()
}

fun updateConfig(config: RemoteConfigImpl) {
Expand All @@ -41,7 +41,11 @@ object RemoteConfig {
@Suppress("unused")
@Serializable
class RemoteConfigCommonV1 {
val yir: RemoteConfigYearInReview? = null
val yir: List<RemoteConfigYearInReview> = emptyList()

fun getYirForYear(year: Int): RemoteConfigYearInReview? {
return yir.find { it.year == year }
}
}

@Suppress("unused")
Expand Down Expand Up @@ -93,7 +97,7 @@ object RemoteConfig {
@Serializable
class TopReadPercentage(
val identifier: String = "",
val min: Int? = null,
val max: Int? = null
val min: Int = 0,
val max: Int = Int.MAX_VALUE
)
}
Loading