[Backport release-11.x] Don't remove old Microsoft accounts until they're successfully reauthenticated (#5640)

This commit is contained in:
Alexandru Ionut Tripon 2026-06-04 08:38:55 +03:00 committed by GitHub
commit 3acfc06463
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) {
auto* accounts = APPLICATION->accounts();
const bool isDefault = accounts->defaultAccount() == account;
accounts->removeAccount(accounts->index(accounts->findAccountByProfileId(account->profileId())));
if (account->accountType() == AccountType::MSA) {
auto newAccount = MSALoginDialog::newAccount(m_parentWidget);
if (newAccount != nullptr) {
accounts->removeAccount(accounts->index(accounts->findAccountByProfileId(account->profileId())));
accounts->addAccount(newAccount);
if (isDefault) {