mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Fix offline accounts not being refreshed during launch (#5542)
This commit is contained in:
commit
23c34f495f
1 changed files with 3 additions and 9 deletions
|
|
@ -133,14 +133,6 @@ LaunchDecision LaunchController::decideLaunchMode()
|
||||||
return LaunchDecision::Continue;
|
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();
|
const auto* accounts = APPLICATION->accounts();
|
||||||
MinecraftAccountPtr accountToCheck = nullptr;
|
MinecraftAccountPtr accountToCheck = nullptr;
|
||||||
|
|
||||||
|
|
@ -163,7 +155,9 @@ LaunchDecision LaunchController::decideLaunchMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
auto state = accountToCheck->accountState();
|
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();
|
accountToCheck->refresh();
|
||||||
state = AccountState::Working;
|
state = AccountState::Working;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue