QML UI: make return to dive list work when entering credentials

If the user tapped on the "Cloud credentials" menu and wants to go back to the
dive list (by selecting that option from the menu), allow them to do so if they
previously had valid credentials.

This allows them to go back to the dive list even on a device without a back
button like an iOS device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-03-13 11:41:09 -07:00
parent 8dcb6fa25c
commit 4f935595d9

View file

@ -46,6 +46,13 @@ MobileComponents.ApplicationWindow {
Action {
text: "Dive list"
onTriggered: {
if (manager.credentialStatus == QMLManager.UNKNOWN) {
// the user has asked to change credentials - if the credentials before that
// were valid, go back to dive list
if (oldStatus == QMLManager.VALID || oldStatus == QMLManager.VALID_EMAIL) {
manager.credentialStatus = oldStatus
}
}
returnTopPage()
globalDrawer.close()
}