fix unnecessary empty requests to fronyx API

This commit is contained in:
johan12345
2023-02-14 19:25:25 +01:00
parent 086cc51dd3
commit a86f1397f4

View File

@@ -250,6 +250,10 @@ class MapViewModel(application: Application, private val state: SavedStateHandle
).any { filtered.contains(it) }
} ?: true
}.flatMap { it.value }
if (allEvseIds.isEmpty()) {
emit(Resource.success(emptyList()))
return@liveData
}
try {
val result = predictionApi.getPredictionsForEvseIds(allEvseIds)
if (result.size == allEvseIds.size) {