mobile/page-selection: consistently use showPage to select a page

We still used pageStack.push() all over the place.

Also, in showPage, disable the map hack if the user actively picks a
different page.

This should fix an issue where the user picked the map and then tried to
add a dive to the dive list - and instead of the dive edit was shown the
map again.

Reported-by: Hartley Horwitz <hhrwtz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-25 20:29:05 -07:00
parent 69272eefa8
commit f2a48e813f
2 changed files with 17 additions and 20 deletions

View file

@ -65,12 +65,7 @@ Kirigami.ScrollablePage {
manager.appendTextToLog("clicked on dive")
if (detailsWindow.state === "view") {
manager.selectRow(model.row);
// switch to detailsWindow (or push it if it's not in the stack)
var i = rootItem.pageIndex(detailsWindow)
if (i === -1)
pageStack.push(detailsWindow)
else
pageStack.currentIndex = i
showPage(detailsWindow)
}
}
}
@ -305,7 +300,7 @@ Kirigami.ScrollablePage {
tripEditWindow.tripId = currentItem.myData.tripId
tripEditWindow.tripLocation = currentItem.myData.tripLocation
tripEditWindow.tripNotes = currentItem.myData.tripNotes
pageStack.push(tripEditWindow)
showPage(tripEditWindow)
}
}