Merge pull request #2615 from nextcloud/fetch_apps_on_connectivity_changes_only

Fetch apps when we get connected only
This commit is contained in:
Kevin Ottens 2020-11-05 13:55:36 +01:00 committed by GitHub
commit 46aba0832d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,13 @@ AccountState::AccountState(AccountPtr account)
connect(account.data(), &Account::credentialsAsked,
this, &AccountState::slotCredentialsAsked);
_timeSinceLastETagCheck.invalidate();
connect(this, &AccountState::isConnectedChanged, [=]{
// Get the Apps available on the server if we're now connected.
if (isConnected()) {
fetchNavigationApps();
}
});
}
AccountState::~AccountState() = default;
@ -236,9 +243,6 @@ void AccountState::checkConnectivity()
// Use a small authed propfind as a minimal ping when we're
// already connected.
conValidator->checkAuthentication();
// Get the Apps available on the server.
fetchNavigationApps();
} else {
// Check the server and then the auth.