Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@nextcloud.com>2020-11-05 15:37:25 +0300
committerKevin Ottens <kevin.ottens@nextcloud.com>2020-11-05 15:37:25 +0300
commit86d240f7b4476b246f7e55ffec3b60a06654fdd8 (patch)
tree134e5030a5d120726ea9691d2324f06dfc15b218 /src/gui/accountstate.cpp
parent6445a61d807974be2148ef424b3efd9ba291fe3e (diff)
Fetch apps when we get connected only
This was right now on the check connectivity beat which is too much when you got many users. Be more conservative there and only update the list of apps when the account gets connected. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Diffstat (limited to 'src/gui/accountstate.cpp')
-rw-r--r--src/gui/accountstate.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 58a679031..b2e757448 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -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.