Setter for a valid selectedType

This commit is contained in:
davide 2022-07-24 14:01:50 +02:00
parent da088ec89e
commit 0859854610

View File

@ -19,8 +19,17 @@ class RepositoryImpl(private val api: SelfossApi, private val apiDetails: ApiDet
override var baseUrl = apiDetails.getBaseUrl() override var baseUrl = apiDetails.getBaseUrl()
// TODO: Validate the string in the setter override var selectedType = "unread"
override var selectedType = "read" set(value) {
field = when (value) {
"all" -> "all"
"unread" -> "unread"
"read" -> "read"
"starred" -> "starred"
else -> "all"
}
}
private var selectedTag: SelfossModel.Tag? = null private var selectedTag: SelfossModel.Tag? = null
private var selectedSource: SelfossModel.Source? = null private var selectedSource: SelfossModel.Source? = null
private var search: String? = null private var search: String? = null