From 6aaa9a40b6ca57b018f1c9172049dbe34b8632f8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 4 Apr 2020 14:15:29 -0700 Subject: mobile/cloud-storage: correctly transition from no-cloud to cloud We know that we have valid credentials, so calling openLocalThenRemote() makes no sense, worse, it doesn't respect the special case of transitioning between accounts. That's the whole point of having a separate loadDivesWithValidCredentials() call. Once we have transitioned state, we need to record the now current state as the old state so that future transitions will work. Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index ce998062d..11e71c5a2 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -608,8 +608,6 @@ void QMLManager::saveCloudCredentials(const QString &newEmail, const QString &ne // let's make sure there are no unsaved changes saveChangesLocal(); syncLoadFromCloud(); - QString url; - getCloudURL(url); manager()->clearAccessCache(); // remove any chached credentials clear_git_id(); // invalidate our remembered GIT SHA MobileModels::instance()->clear(); @@ -619,8 +617,9 @@ void QMLManager::saveCloudCredentials(const QString &newEmail, const QString &ne // of whether we're in offline mode or not, to make sure the repository is synced currentGitLocalOnly = git_local_only; git_local_only = false; - openLocalThenRemote(url); + loadDivesWithValidCredentials(); } + setOldStatus((qPrefCloudStorage::cloud_status)qPrefCloudStorage::cloud_verification_status()); } bool QMLManager::verifyCredentials(QString email, QString password, QString pin) -- cgit v1.2.3-70-g09d2