fix(LaunchController): don't remove account unless we have a new one

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2026-06-01 13:27:53 +05:00
parent bf8d1ca1f8
commit f6d1b29b04
No known key found for this signature in database
GPG key ID: B77C34313AEE1FFF

View file

@ -333,11 +333,11 @@ bool LaunchController::reauthenticateAccount(const MinecraftAccountPtr& account,
if (button == QMessageBox::StandardButton::Yes) { if (button == QMessageBox::StandardButton::Yes) {
auto* accounts = APPLICATION->accounts(); auto* accounts = APPLICATION->accounts();
const bool isDefault = accounts->defaultAccount() == account; const bool isDefault = accounts->defaultAccount() == account;
accounts->removeAccount(accounts->index(accounts->findAccountByProfileId(account->profileId())));
if (account->accountType() == AccountType::MSA) { if (account->accountType() == AccountType::MSA) {
auto newAccount = MSALoginDialog::newAccount(m_parentWidget); auto newAccount = MSALoginDialog::newAccount(m_parentWidget);
if (newAccount != nullptr) { if (newAccount != nullptr) {
accounts->removeAccount(accounts->index(accounts->findAccountByProfileId(account->profileId())));
accounts->addAccount(newAccount); accounts->addAccount(newAccount);
if (isDefault) { if (isDefault) {