Fix NeoChat not syncing

This problem was caused because addConnection was starting the sync
proccess unfortunally because the user wasn't connected this aborted
almost immediately and then the sync proccess wouldn't run at all.

Now start the sync proccess after making sure we are connected.

Fix #228
This commit is contained in:
Carl Schwan
2021-01-08 21:35:37 +01:00
parent ca5f95b298
commit 2e0096380f

View File

@@ -269,9 +269,9 @@ void Controller::invokeLogin()
auto accessToken = loadAccessTokenFromKeyChain(account);
auto connection = new Connection(account.homeserver(), this);
addConnection(connection);
connect(connection, &Connection::connected, this, [=] {
connection->loadState();
addConnection(connection);
if (connection->userId() == id) {
setActiveConnection(connection);
Q_EMIT initiated();