update only when map is idle

fixes error introduced in aa5c36d
This commit is contained in:
johan12345
2022-06-26 17:49:09 +02:00
parent 0bf56701cc
commit f8378eb338

View File

@@ -117,7 +117,9 @@ class MapViewModel(application: Application, private val state: SavedStateHandle
MediatorLiveData<Resource<List<ChargepointListItem>>>()
.apply {
value = Resource.loading(emptyList())
listOf(mapPosition, filtersWithValue, referenceData).forEach {
// this is not automatically updated with mapPosition, as we only want to update
// when map is idle.
listOf(filtersWithValue, referenceData).forEach {
addSource(it) {
reloadChargepoints()
}