Skip to content

Commit

Permalink
Merge pull request #3948 from nextcloud/bugfix/pn-connection-check
Browse files Browse the repository at this point in the history
Don't do a connection checks when using push notifications
  • Loading branch information
mgallien committed Nov 4, 2021
2 parents d11935b + d661e91 commit 7dd09b8
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 7dd09b8

Please sign in to comment.