Don't remove old Microsoft accounts until they're successfully reauthenticated (#5620)

This commit is contained in:
Seth Flynn 2026-06-04 03:57:25 +00:00 committed by GitHub
commit dd5261f7ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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) {