Commit bc5b6841 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

account: update info after migration

Change-Id: I11474b70cc7de1ea8b9ac5d38f22686cb1289b07
parent 4db0f519
...@@ -536,9 +536,17 @@ void ...@@ -536,9 +536,17 @@ void
NewAccountModelPimpl::slotMigrationEnded(const std::string& accountId, bool ok) NewAccountModelPimpl::slotMigrationEnded(const std::string& accountId, bool ok)
{ {
if (ok) { if (ok) {
// Previous account was incorrect, force a full reload auto it = accounts.find(accountId);
removeFromAccounts(accountId); if (it == accounts.end()) {
addToAccounts(accountId); addToAccounts(accountId);
return;
}
auto& accountInfo = it->second.first;
MapStringString details = ConfigurationManager::instance().getAccountDetails(accountId.c_str());
accountInfo.fromDetails(details);
MapStringString volatileDetails = ConfigurationManager::instance().getVolatileAccountDetails(accountId.c_str());
std::string daemonStatus = volatileDetails[DRing::Account::ConfProperties::Registration::STATUS].toStdString();
accountInfo.status = lrc::api::account::to_status(daemonStatus);
} }
emit linked.migrationEnded(accountId, ok); emit linked.migrationEnded(accountId, ok);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment