Auth abort fixes (#3851)
This commit is contained in:
commit
fbac04c170
2 changed files with 11 additions and 5 deletions
|
@ -200,7 +200,7 @@ void LaunchController::login()
|
||||||
if ((m_accountToUse->accountType() != AccountType::Offline && m_accountToUse->accountState() == AccountState::Offline) ||
|
if ((m_accountToUse->accountType() != AccountType::Offline && m_accountToUse->accountState() == AccountState::Offline) ||
|
||||||
m_accountToUse->shouldRefresh()) {
|
m_accountToUse->shouldRefresh()) {
|
||||||
// Force account refresh on the account used to launch the instance updating the AccountState
|
// Force account refresh on the account used to launch the instance updating the AccountState
|
||||||
// only on first try and if it is not meant to be offline
|
// only on first try and if it is not meant to be offline
|
||||||
m_accountToUse->refresh();
|
m_accountToUse->refresh();
|
||||||
}
|
}
|
||||||
while (tryagain) {
|
while (tryagain) {
|
||||||
|
@ -296,11 +296,15 @@ void LaunchController::login()
|
||||||
case AccountState::Working: {
|
case AccountState::Working: {
|
||||||
// refresh is in progress, we need to wait for it to finish to proceed.
|
// refresh is in progress, we need to wait for it to finish to proceed.
|
||||||
ProgressDialog progDialog(m_parentWidget);
|
ProgressDialog progDialog(m_parentWidget);
|
||||||
if (m_online) {
|
progDialog.setSkipButton(true, tr("Abort"));
|
||||||
progDialog.setSkipButton(true, tr("Play Offline"));
|
|
||||||
}
|
|
||||||
auto task = accountToCheck->currentTask();
|
auto task = accountToCheck->currentTask();
|
||||||
progDialog.execWithTask(task.get());
|
progDialog.execWithTask(task.get());
|
||||||
|
|
||||||
|
// don't retry if aborted
|
||||||
|
if (task->getState() == Task::State::AbortedByUser)
|
||||||
|
tryagain = false;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case AccountState::Expired: {
|
case AccountState::Expired: {
|
||||||
|
|
|
@ -181,8 +181,10 @@ void MinecraftAccount::authFailed(QString reason)
|
||||||
data.validity_ = Validity::None;
|
data.validity_ = Validity::None;
|
||||||
emit changed();
|
emit changed();
|
||||||
} break;
|
} break;
|
||||||
|
case AccountTaskState::STATE_WORKING: {
|
||||||
|
data.accountState = AccountState::Unchecked;
|
||||||
|
} break;
|
||||||
case AccountTaskState::STATE_CREATED:
|
case AccountTaskState::STATE_CREATED:
|
||||||
case AccountTaskState::STATE_WORKING:
|
|
||||||
case AccountTaskState::STATE_SUCCEEDED: {
|
case AccountTaskState::STATE_SUCCEEDED: {
|
||||||
// Not reachable here, as they are not failures.
|
// Not reachable here, as they are not failures.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue