mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-20 14:18:20 -04:00
MapScreen: avoid updating chargers twice, which can lead to crashes
due to template update limit
This commit is contained in:
@@ -332,7 +332,7 @@ class MapScreen(ctx: CarContext, val session: EVMapSession) :
|
||||
zoom = 16f,
|
||||
filters
|
||||
).awaitFinished()
|
||||
chargers = response.data?.filterIsInstance(ChargeLocation::class.java)
|
||||
var chargers = response.data?.filterIsInstance(ChargeLocation::class.java)
|
||||
chargers?.let {
|
||||
if (it.size < maxRows) {
|
||||
// try again with larger radius
|
||||
@@ -346,6 +346,7 @@ class MapScreen(ctx: CarContext, val session: EVMapSession) :
|
||||
response.data?.filterIsInstance(ChargeLocation::class.java)
|
||||
}
|
||||
}
|
||||
this@MapScreen.chargers = chargers
|
||||
}
|
||||
|
||||
updateCoroutine = null
|
||||
|
||||
Reference in New Issue
Block a user