From 1ef03583f959b6ebeb4e37ac07e5907944e4d777 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Wed, 13 May 2026 17:59:03 +0500 Subject: [PATCH] fix offline accounts not being refreshed during launch Closes #5435 Closes #5537 Signed-off-by: Octol1ttle (cherry picked from commit bc1f9db6539c0b70cff674165dc345a789f98b05) --- launcher/LaunchController.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 8892a5466..f7ea23eb3 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -133,14 +133,6 @@ LaunchDecision LaunchController::decideLaunchMode() return LaunchDecision::Continue; } - if (m_wantedLaunchMode == LaunchMode::Normal) { - if (m_accountToUse->shouldRefresh() || 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 - m_accountToUse->refresh(); - } - } - const auto* accounts = APPLICATION->accounts(); MinecraftAccountPtr accountToCheck = nullptr; @@ -163,7 +155,9 @@ LaunchDecision LaunchController::decideLaunchMode() } auto state = accountToCheck->accountState(); - if (state == AccountState::Unchecked || state == AccountState::Errored) { + const bool needsRefresh = + m_wantedLaunchMode == LaunchMode::Normal && (state == AccountState::Offline || accountToCheck->shouldRefresh()); + if (state == AccountState::Unchecked || state == AccountState::Errored || needsRefresh) { accountToCheck->refresh(); state = AccountState::Working; }