diff --git a/Core/Core/Credentials/AccountManager.cs b/Core/Core/Credentials/AccountManager.cs index 66888f0325..b304aaa573 100644 --- a/Core/Core/Credentials/AccountManager.cs +++ b/Core/Core/Credentials/AccountManager.cs @@ -238,7 +238,7 @@ public static string GetDefaultServerUrl() /// Upgrades an account from the account.serverInfo.movedFrom account to the account.serverInfo.movedTo account /// /// Id of the account to upgrade - public static void UpgradeAccount(string id) + public static async Task UpgradeAccount(string id) { var account = GetAccounts().FirstOrDefault(acc => acc.id == id) @@ -259,7 +259,9 @@ public static void UpgradeAccount(string id) // setting the id to null will force it to be recreated account.id = null; - s_accountStorage.UpdateObject(account.id!, JsonConvert.SerializeObject(account)); + RemoveAccount(id); + s_accountStorage.SaveObject(account.id, JsonConvert.SerializeObject(account)); + await s_accountStorage.WriteComplete().ConfigureAwait(false); } ///