mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Don't do a connection checks when using push notifications
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>
This commit is contained in:
parent
d11935b6fc
commit
d661e91a58
@ -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"
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user