diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 8844ae105..2c76fee4f 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -145,6 +145,12 @@ void LaunchController::login() bool tryagain = true; unsigned int tries = 0; + if (!m_accountToUse->isOffline() && m_accountToUse->accountState() == AccountState::Offline) { + // 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 + auto accounts = APPLICATION->accounts(); + accounts->requestRefresh(m_accountToUse->internalId()); + } while (tryagain) { if (tries > 0 && tries % 3 == 0) { auto result = @@ -156,12 +162,6 @@ void LaunchController::login() return; } } - if (!m_accountToUse->isOffline() && m_accountToUse->accountState() == AccountState::Offline && tries == 0) { - // 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 - auto accounts = APPLICATION->accounts(); - accounts->requestRefresh(m_accountToUse->internalId()); - } tries++; m_session = std::make_shared(); m_session->wants_online = m_online;