Mobile: update the map when the selected dive changes

Now we see the highlighted dive flag match the dive selected in the dive
list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-10-07 22:38:20 -05:00
parent 9a73be9207
commit fda10b8baa

View file

@ -214,7 +214,15 @@ Kirigami.Page {
}
onCurrentItemChanged: {
// why do we do this? What consumes this?
manager.selectedDiveTimestamp = currentItem.modelData.dive.timestamp
// make sure the core data structures reflect that this dive is selected
manager.selectDive(currentItem.modelData.dive.id)
// update the map to show the highlighted flag and center on it
if (rootItem.pageIndex(mapPage) !== -1) {
mapPage.reloadMap()
mapPage.centerOnDiveSite(currentItem.modelData.dive.dive_site)
}
}
function showDiveIndex(index) {