summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-22 16:21:15 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-26 11:38:26 -0700
commitf69b93de40949294e967702f45e818c50d3db0b9 (patch)
tree19ff203c7f5945b322c2d26052984552231b6119 /mobile-widgets/qml
parent4e583f91206a7f62c73bed58a338ebc28620774c (diff)
downloadsubsurface-f69b93de40949294e967702f45e818c50d3db0b9.tar.gz
Mobile: don't push map page if it's already on the stack
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/main.qml7
1 files changed, 6 insertions, 1 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 8827651a8..c338fa04c 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -90,7 +90,12 @@ Kirigami.ApplicationWindow {
function showMap() {
if (globalDrawer.drawerOpen)
globalDrawer.close()
- pageStack.push(mapPage)
+ var i=pageIndex(mapPage)
+ if (i === -1)
+ pageStack.push(mapPage)
+ else
+ pageStack.currentIndex = i
+
}
function pageIndex(pageToFind) {