mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 05:45:42 +03:00
Only run the CheckQuota job if the account is connected
We use another job to check the connection. And this may cause wrong password failure as we are still in the wizzard Fixes #1567
This commit is contained in:
parent
0a5e691ba3
commit
cabcdd890e
1 changed files with 3 additions and 2 deletions
|
@ -52,10 +52,10 @@ void QuotaInfo::slotAccountStateChanged(int state)
|
|||
switch (state) {
|
||||
case Account::SignedOut: // fall through
|
||||
case Account::InvalidCredidential:
|
||||
case Account::Disconnected:
|
||||
_jobRestartTimer->stop();
|
||||
break;
|
||||
case Account::Connected: // fall through
|
||||
case Account::Disconnected:
|
||||
slotCheckQuota();
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,8 @@ void QuotaInfo::slotRequestFailed()
|
|||
|
||||
void QuotaInfo::slotCheckQuota()
|
||||
{
|
||||
if (!_account.isNull() && _account->credentials() && _account->credentials()->ready()) {
|
||||
if (!_account.isNull() && _account->state() == Account::Connected
|
||||
&& _account->credentials() && _account->credentials()->ready()) {
|
||||
CheckQuotaJob *job = new CheckQuotaJob(_account, "/", this);
|
||||
connect(job, SIGNAL(quotaRetrieved(qint64,qint64)), SLOT(slotUpdateLastQuota(qint64,qint64)));
|
||||
connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotRequestFailed()));
|
||||
|
|
Loading…
Reference in a new issue