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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-04-04 14:15:29 -07:00
parent 7757ce878b
commit 6aaa9a40b6

View file

@ -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)