mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-20 14:18:20 -04:00
plugs filter: return empty list if none chosen (#9)
This commit is contained in:
@@ -223,7 +223,6 @@ class FiltersAdapter : DataBindingAdapter<FilterWithValue<FilterValue>>() {
|
||||
value.values.add(choice.key)
|
||||
} else {
|
||||
value.values.remove(choice.key)
|
||||
value.all = false
|
||||
}
|
||||
updateButtons()
|
||||
}
|
||||
|
||||
@@ -149,6 +149,10 @@ class MapViewModel(application: Application, geApiKey: String) : AndroidViewMode
|
||||
val connectorsVal =
|
||||
filters.find { it.value.key == "connectors" }!!.value as MultipleChoiceFilterValue
|
||||
val connectors = if (connectorsVal.all) null else connectorsVal.values.joinToString(",")
|
||||
if (connectorsVal.values.isEmpty() && !connectorsVal.all) {
|
||||
// no connectors chosen
|
||||
return Resource.success(emptyList())
|
||||
}
|
||||
|
||||
// do not use clustering if filters need to be applied locally.
|
||||
val useClustering = minConnectors <= 1
|
||||
|
||||
Reference in New Issue
Block a user