From 42eae7e48bd4d4887d58d794548540f215bbc9b1 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Tue, 2 Oct 2018 13:16:12 +0200 Subject: Mobile: simpify startup logic When starting the mobile app, I noticed a short display of an empty page with title "Cloud creditials" just before showing the divelist. Simply a not nice visual effect. This commit simplifies some logic and resolves this. As the code in this part is fragile, this is tested for normal and clean startup of the app, switching credentials, from no cloud to valid account (which even nicely imports the no cloud dives: this surprised me as I have never seen this working). Signed-off-by: Jan Mulder --- mobile-widgets/qml/DiveList.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 9edf1692e..65dce34bd 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -334,12 +334,8 @@ Kirigami.ScrollablePage { visible: opacity > 0 Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } function setupActions() { - if (visible) { - page.actions.main = null - page.actions.right = null - page.title = qsTr("Cloud credentials") - } else if (prefs.credentialStatus === CloudStatus.CS_VERIFIED || - prefs.credentialStatus === CloudStatus.CS_NOCLOUD) { + if (prefs.credentialStatus === CloudStatus.CS_VERIFIED || + prefs.credentialStatus === CloudStatus.CS_NOCLOUD) { page.actions.main = page.downloadFromDCAction page.actions.right = page.addDiveAction page.title = qsTr("Dive list") @@ -348,7 +344,7 @@ Kirigami.ScrollablePage { } else { page.actions.main = null page.actions.right = null - page.title = qsTr("Dive list") + page.title = qsTr("Cloud credentials") } } onVisibleChanged: { -- cgit v1.2.3-70-g09d2