Don't retry account refresh if aborted
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
f19fe41937
commit
834eb5a90d
1 changed files with 14 additions and 4 deletions
|
@ -296,11 +296,21 @@ 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();
|
||||||
|
|
||||||
|
bool aborted = false;
|
||||||
|
auto abortListener = connect(task.get(), &Task::aborted, [&aborted] { aborted = true; });
|
||||||
|
|
||||||
progDialog.execWithTask(task.get());
|
progDialog.execWithTask(task.get());
|
||||||
|
|
||||||
|
disconnect(abortListener);
|
||||||
|
|
||||||
|
// don't retry if aborted
|
||||||
|
if (aborted)
|
||||||
|
tryagain = false;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case AccountState::Expired: {
|
case AccountState::Expired: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue