diff options
author | Tobias Fella <fella@posteo.de> | 2022-05-31 19:43:01 +0200 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2022-05-31 19:51:06 +0200 |
commit | fe66480d4f6d96444ca090df2ae04dc7da033ea4 (patch) | |
tree | 6f482c1ac916ae35e00e48b9fb14058752cd3f58 | |
parent | 6e27a49fbbc58a7310753f882fe372ddb0f63e33 (diff) | |
download | libquotient-fe66480d4f6d96444ca090df2ae04dc7da033ea4.tar.gz libquotient-fe66480d4f6d96444ca090df2ae04dc7da033ea4.zip |
Remove accounts from accountsLoading when they're no longer loading
-rw-r--r-- | lib/accountregistry.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/accountregistry.cpp b/lib/accountregistry.cpp index b40d5ecf..289f20dd 100644 --- a/lib/accountregistry.cpp +++ b/lib/accountregistry.cpp @@ -99,20 +99,29 @@ void AccountRegistry::invokeLogin() AccountSettings account { accountId }; auto connection = new Connection(account.homeserver()); connect(connection, &Connection::connected, this, - [connection] { + [connection, this, accountId] { connection->loadState(); connection->setLazyLoading(true); connection->syncLoop(); + + m_accountsLoading.removeAll(accountId); + emit accountsLoadingChanged(); }); connect(connection, &Connection::loginError, this, - [this, connection](const QString& error, + [this, connection, accountId](const QString& error, const QString& details) { emit loginError(connection, error, details); + + m_accountsLoading.removeAll(accountId); + emit accountsLoadingChanged(); }); connect(connection, &Connection::resolveError, this, - [this, connection](const QString& error) { + [this, connection, accountId](const QString& error) { emit resolveError(connection, error); + + m_accountsLoading.removeAll(accountId); + emit accountsLoadingChanged(); }); connection->assumeIdentity( account.userId(), accessTokenLoadingJob->binaryData(), |