properly detect need to sign terms of service state

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-10-22 22:39:38 +02:00
parent 0190bf68f3
commit 79fa7cd04f
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553

View file

@ -359,14 +359,14 @@ void AccountState::slotConnectionValidatorResult(ConnectionValidator::Status sta
return; return;
} }
_lastConnectionValidatorStatus = status;
if ((_lastConnectionValidatorStatus == ConnectionValidator::NeedToSignTermsOfService && status == ConnectionValidator::Connected) || if ((_lastConnectionValidatorStatus == ConnectionValidator::NeedToSignTermsOfService && status == ConnectionValidator::Connected) ||
(status == ConnectionValidator::NeedToSignTermsOfService && _lastConnectionValidatorStatus != status)) { (status == ConnectionValidator::NeedToSignTermsOfService && _lastConnectionValidatorStatus != status)) {
emit termsOfServiceChanged(_account); emit termsOfServiceChanged(_account);
} }
_lastConnectionValidatorStatus = status;
// Come online gradually from 503, captive portal(redirection) or maintenance mode // Come online gradually from 503, captive portal(redirection) or maintenance mode
if (status == ConnectionValidator::Connected if (status == ConnectionValidator::Connected
&& (_connectionStatus == ConnectionValidator::ServiceUnavailable && (_connectionStatus == ConnectionValidator::ServiceUnavailable