Skip to content

Commit

Permalink
Don't do a connection checks when using push notifications
Browse files Browse the repository at this point in the history
When using push notifications, it is not necessary to do regular
connection checks because the push notifications will take care of it.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
  • Loading branch information
Felix Weilbach committed Nov 4, 2021
1 parent f3af4ce commit e574569
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/application.cpp
Expand Up @@ -34,6 +34,7 @@
#include "sharedialog.h"
#include "accountmanager.h"
#include "creds/abstractcredentials.h"
#include "pushnotifications.h"

#if defined(BUILD_UPDATER)
#include "updater/ocupdater.h"
Expand Down Expand Up @@ -459,9 +460,10 @@ void Application::slotCheckConnection()

// Don't check if we're manually signed out or
// when the error is permanent.
if (state != AccountState::SignedOut
&& state != AccountState::ConfigurationError
&& state != AccountState::AskingCredentials) {
const auto pushNotifications = accountState->account()->pushNotifications();
const auto pushNotificationsAvailable = (pushNotifications && pushNotifications->isReady());
if (state != AccountState::SignedOut && state != AccountState::ConfigurationError
&& state != AccountState::AskingCredentials && !pushNotificationsAvailable) {
accountState->checkConnectivity();
}
}
Expand Down

0 comments on commit e574569

Please sign in to comment.