mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-20 14:18:20 -04:00
update favorite data when opening favorite detail view from list
This commit is contained in:
@@ -434,6 +434,11 @@ class MapViewModel(application: Application, private val state: SavedStateHandle
|
||||
chargerDetails.value = response
|
||||
if (response.status == Status.SUCCESS) {
|
||||
chargerSparse.value = response.data
|
||||
|
||||
if (response.data != null && favorites.value?.any { it.charger.id == response.data.id } == true) {
|
||||
// update data of stored favorite
|
||||
db.chargeLocationsDao().insert(response.data)
|
||||
}
|
||||
} else {
|
||||
chargerSparse.value = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user