QML UI: don't show bogus warning if page stack is reset

As we clear all the pages from the stack, we can briefly have no valid currentItem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-08-08 19:49:48 -07:00
parent ae6756e7f1
commit f8d551ac6e

View file

@ -546,6 +546,9 @@ if you have network connectivity and want to sync your data to cloud storage."),
// This is called whenever the user navigates using the breadcrumbs in the header // This is called whenever the user navigates using the breadcrumbs in the header
// disable the left swipe to go back when on the map page // disable the left swipe to go back when on the map page
if (pageStack.currentItem === null) {
console.log("there's no current page")
} else {
stackView.interactive = pageStack.currentItem.objectName !== mapPage.objectName stackView.interactive = pageStack.currentItem.objectName !== mapPage.objectName
// is there a better way to reload the map markers instead of doing that // is there a better way to reload the map markers instead of doing that
@ -560,6 +563,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
detailsWindow.endEditMode() detailsWindow.endEditMode()
} }
} }
}
QMLPrefs { QMLPrefs {
id: prefs id: prefs