From 86d240f7b4476b246f7e55ffec3b60a06654fdd8 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Thu, 5 Nov 2020 13:37:25 +0100 Subject: [PATCH] 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 --- src/gui/accountstate.cpp | 10 +++++++--- 1 file 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. -- 2.30.2