From 2863a691ef4687eefa47e8fbfd4e5f6e06cce877 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 31 Oct 2023 08:45:08 +0200 Subject: [PATCH] moved refresh out of the loop Signed-off-by: Trial97 --- launcher/LaunchController.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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;